我正在尝试在 Ubuntu 中制作文件,当我制作文件时,我不断收到此错误:
/usr/bin/ld: ../../gtest-1.7.0/libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [src/tests/run_tests] Error 1
make[1]: *** [src/tests/CMakeFiles/run_tests.dir/all] Error 2
make: *** [all] Error 2
我看到有人提到要进入 Makefile 并将“-L/lib64 -l pthread”添加到变量 LDFLAGS 中,但您是怎么做到的?这里是 linux 的新手 =X
最佳答案
上面的链接问题通过添加
解决-lpthread -lm to CMakeLists.txt (target link libraries for luxrender);
TARGET_LINK_LIBRARIES(... -lpthread -lm)
关于linux - 对符号 'pthread_key_delete@@GLIBC_2.2.5 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25617839/