Linking c++ dll with Haskell-Platform on Windows, outputs 'undefined reference'

后端 未结 1 1394
小蘑菇
小蘑菇 2021-01-06 02:49

I am a Haskell enthusiast and have got stuck upon compiling my little Haskell program on Windows. My program uses the iconv package, which in turn uses the foreign library w

相关标签:
1条回答
  • 2021-01-06 03:23

    Installing libiconv is a little tricky on Windows.

    1. Download libiconv binary and developer files from it site here
    2. Unzip both packages over mingw folder, which is inside your Haskell Platform folder.
    3. Download cabal package for Iconv latest version for the moment
    4. Edit iconv.cabal file, so lines with include-dirs and extra-lib-dirs will looks like

      include-dirs:    cbits, "C:\\HaskellPlatform\\2013.2.0.0\\mingw\\include"
      extra-lib-dirs:  "C:\\HaskellPlatform\\2013.2.0.0\\mingw\\lib"
      

    notice the double dashes in windows path, and edit it to your path of Haskell Platform.

    1. Edit iconv.cabal file, there is a line with if os(darwin) || os(freebsd), change it to if os(darwin) || os(freebsd) || os(windows)
    2. Thats it, now you can run cabal install command from iconv pachage dir
    0 讨论(0)
提交回复
热议问题