我有一个Haskell stack项目,其中我一直在使用llvm-hs库来构建一个可以发出LLVM的编译器。到目前为止,我一直在使用LLVM版本8.0.0。最近,由于我的系统进行了Python升级,LLVM版本升级到了8.0.1。
当我尝试执行stack build时,我得到以下错误-
ld: warning: directory not found for option '-L/usr/local/Cellar/llvm-8/8.0.0/lib/llvm-8/lib'
ld: library not found for -lLLVM-8
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)从上面看,ld正在寻找-L/usr/local/Cellar/llvm-8/8.0.0/lib/llvm-8/lib,而在我的系统上,我目前有8.0.1的版本。如何将ld指向正确的路径?
我在运行MacOS Mojave。堆栈版本2.3.1。谢谢
发布于 2020-07-12 05:38:12
我能够通过将以下内容添加到我的.bash_profile中来解决这个问题
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/Cellar/llvm-8/8.0.1/lib/llvm-8/lib"如果有人遇到了同样的问题,希望这会有所帮助。
https://stackoverflow.com/questions/62853408
复制相似问题