【发布时间】:2014-01-24 07:40:56
【问题描述】:
好吧,我不知道发生了什么?我只是在我的 macbook 上遵循一些说明(显然是针对 ubuntu 操作系统)。
在最后一步之前一切都很好。
当我执行make 时,我看到以下错误:
Linking CXX executable ../../bin/test-wordcount
ld: warning: path '/usr/local/lib/libprotobuf.dylib' following -L not a directory
ld: warning: path '/usr/local/lib/libzmq.dylib' following -L not a directory
Undefined symbols for architecture x86_64:
"_del_curterm", referenced from:
terminalHasColors(int) in libLLVMSupport.a(Process.o)
"_set_curterm", referenced from:
terminalHasColors(int) in libLLVMSupport.a(Process.o)
"_setupterm", referenced from:
terminalHasColors(int) in libLLVMSupport.a(Process.o)
"_tigetnum", referenced from:
terminalHasColors(int) in libLLVMSupport.a(Process.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/test-wordcount] Error 1
make[1]: *** [test/wordcount/CMakeFiles/test-wordcount.dir/all] Error 2
make: *** [all] Error 2
我错过了什么?
我的 Cmakelists.txt 文件 http://collabedit.com/8vc7s
【问题讨论】:
-
那是你自己的项目吗?如果不是,它是什么版本的项目?如果是您自己的,请尝试将 CMakeLists.txt 中的
-L替换为-l(小写 L)。 -
@user2799037:我在 CMakeLists.txt 中没有看到任何 -L :(
-
如何添加库?应该使用 `add_library CMake 会自动添加正确的 -L/-l。
-
@user2799037 :我很抱歉烦人.. 但这是我的文件:collabedit.com/8vc7s 我应该添加什么...我应该在哪里添加..
-
我无法访问您的链接。一般来说,最好通过编辑将源的相关部分发布到问题中。也许您的问题与警告无关。您在其中一个 cmets OS X 中提到。也许这也是您的问题:stackoverflow.com/q/16352833