无法通过Eclipse编译LLVM-Clang。只需在CDT默认的hello world示例中进行测试即可。它给了以下错误:LLVM-Clang for Mac OS X上的Eclipse CDT
clang++ -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -o src/Test.bc ../src/Test.cpp
llvm-ld -v -native -o Test src/Test.bc
Internal Builder: Cannot run program "llvm-ld": Unknown reason
Error: Program "llvm-ld" is not found in PATHPATH=[/usr/bin:/bin:/usr/sbin:/sbin]
Build error occurred, build is stopped
我不知道为什么它抱怨路径,因为我可以调用铛++和LLVM-LD通过终端就好了命令。事实上,当我通过终端键入上述内容时,我得到以下错误。
clang++ -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -o src/Test.bc ../src/Test.cpp
llvm-ld -v -native -o Test Debug/src/Test.bc
Linking bitcode file 'Debug/src/Test.bc'
llvm-ld: error: Cannot load file 'Debug/src/Test.bc': Bitcode file 'Debug/src/Test.bc' could not be loaded: unknown type in type table
那么它可能不是Eclipse的问题?从来没有很多的命令行编译人员,所以我的知识是有限的。
我正在运行狮子。通过XCode命令行工具安装clang。通过Macports安装LLVM。必须手动设置LLVM的路径。
锵-v说3.1
LLVM是3.0
Eclipse是否使用与shell相同的路径?错误提示'PATH = [/ usr/bin:/ bin:/ usr/sbin:/ sbin]',但llvm-ld可能位于/ opt/local/bin之类的地方。 – matt 2012-03-10 19:47:18
我在哪里可以找到Eclipse正在使用的路径? – 2012-03-10 20:56:06
对不起,自从我使用Eclipse之后已经有一段时间了,然后它只是Java - 我没有使用过CDT。您必须查看Eclipse的首选项并查看是否可以找到它。 – matt 2012-03-10 21:10:33