生成软件包时Cmake错误

Moh*_*hit 2 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
Run Code Online (Sandbox Code Playgroud)

我想念什么?

我的Cmakelists.txt文件 http://collabedit.com/8vc7s

小智 5

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

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

TARGET_LINK_LIBRARIES(myProject ncurses $ {LLVM_LIBRARY} [...您的所有库])