编译libtensor库时OsX上的链接器错误

时间:2019-04-02 20:53:54

标签: c++ macos compilation linker ld

我正在尝试在OsX上编译libtensor库,但无法将其与ctf库(自编译)链接起来

并以

停止
[ 59%] Linking CXX executable libtensor_ctf_iface_tests
Undefined symbols for architecture x86_64:

ld: symbol(s) not found for architecture x86_64

collect2: error: ld returned 1 exit status

make[2]: *** [tests/libtensor_ctf_iface_tests] Error 1

make[1]: *** [tests/CMakeFiles/libtensor_ctf_iface_tests.dir/all] 

Error 2

make: *** [all] Error 2

我用以下方法配置了它:

CC=gcc-8 CXX=g++-8 LIBRARY_PATH=$LIBRARY_PATH:/Users/me/opt/ctf/lib ./configure --with-ctf=/Users/me/opt/ctf -DCMAKE_INSTALL_PREFIX=~/opt/libtensor 

CC=gcc-8 CXX=g++-8  LDFLAGS=$LDFLAGS:-lctf LIBRARY_PATH=$LIBRARY_PATH:/Users/kiwi/opt/ctf/lib ./configure --with-ctf=/Users/kiwi/opt/ctf -DCMAKE_INSTALL_PREFIX=~/opt/libtenso

而且我不知道要更改什么(尝试了几种给库路径LD_FLAGS,LD_LIBRARY_PATH,LIBS的组合...)除了gcc-8 / g ++-以外,我没有使用其他任何编译器来进行配置8

你们每个人都知道我应该改变什么?

0 个答案:

没有答案