构建程序包时出现Cmake错误

时间:2014-01-24 07:40:56

标签: c++ makefile cmake

好的,我不知道发生了什么事?我只是在我的macbook上遵循一些指示(显然是对于ubuntu OS)。

直到最后一步,一切都很顺利。

当我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

2 个答案:

答案 0 :(得分:5)

我知道这是一个旧堆栈,但在寻找此问题的解决方案时,它会出现在前几次搜索命中。

在OSX中,您可能必须向目标链接库添加“ncurses”。即:

TARGET_LINK_LIBRARIES(myProject ncurses                         $ {} LLVM_LIBRARY                         [...所有图书馆])

答案 1 :(得分:1)

您正在使用标题term.h,但包含这些(导出的)符号(del_curterm,...)的库不在您的LD路径term.h上。找到适合您平台的库,安装它并在-L swich中添加列表。

另请参阅有关未存在目录的ld警告