简体   繁体   中英

Cmake error while building a package

Ok, I have no clue what is going on? I am just following some instructions (apparently for ubuntu OS) on my macbook.

Everything was going fine until the last step.

When I do make , I see the following error:

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

What am i missing?

My Cmakelists.txt file http://collabedit.com/8vc7s

I know this is an old stack but it shows up in the first few search hits when seeking solution for this problem.

In OSX you might have to add "ncurses" to your target link libraries. Ie:

TARGET_LINK_LIBRARIES ( myProject ncurses ${LLVM_LIBRARY} [... all of your libraries])

You are using header term.h, but the library that contains these (exported) symbols (del_curterm, ...) is not on your LD path term.h . Find the library that has it for your platform, install it and add list it in -L swich.

Also see the ld warning about unexisting directories

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM