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

百般思念 提交于 2019-11-30 21:13:50

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!