我在Windows上的分析时遇到了一个令人讨厌的问题。但首先,设置的上下文:
- 我在 ~/dev/foo_shared 中创建了一个共享沙箱:
cabal sandbox init --sandbox=.
- 我使用上面的共享沙箱在 ~/dev/foo 中创建了一个沙箱:
cabal sandbox init --sandbox=~/dev/foo_shared
- 我在启用分析的情况下安装了所有依赖项:
cabal install --only-dependencies --enable-library-profiling --enable-executable-profiling
- 我配置了 foo 包,以便它包括分析 RTS:
cabal configure --enable-profiling --enable-executable-profiling
- 我试图用
cabal build
构建
一切都正确构建,但没有链接。然后我用cabal build -v3
重建,这是链接器部分(最有趣的部分):
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lHSrts_debug_p
我用谷歌搜索了一下,IIRC,这是因为我缺少GHC的RTS的分析库。我从来没有在Windows :(找到它最后的信息,我在 Windows 10 上,不确定它是否有帮助。
问题解决了。该问题是由于我在 GHC 的命令行界面上使用-debug
。我被告知-debug
和-p
不兼容,因此出现错误。