Compiling Haskell code in Cygwin, and some other bugs in Haskell Platform on Windows

流过昼夜 提交于 2019-12-01 18:15:46

Without access to your development environment or a listing of the errors that you're getting, I can only assume that the issue is related to the way that you've set up your PATH.

GHC on Windows comes bundled with its own gcc compiler (for C code) and ld linker. If you've installed Cygwin, you've probably also installed the MinGW toolchain, which comes with its own version of gcc and ld. Then, you've probably made your PATH variable list /usr/bin before the path to the Haskell Platform binary directories, which makes ghc find the MinGW linker and C compiler before it finds the versions that were bundled with GHC.

You need to make sure that the HP directories are listed before the Cygwin directories. It should not be like this:

$ echo $PATH
/bin:/usr/bin:.../2011.2.0.1/bin

Instead, it should be like this:

$ echo $PATH
.../2011.2.0.1/bin:/bin:/usr/bin

This is only a guess at what the issue might be, and you should provide more details for a better diagnosis.

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