【发布时间】:2014-10-26 09:23:07
【问题描述】:
我正在尝试在 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 并在变量 LDFLAGS 中添加“-L /lib64 -l pthread”,但你是怎么做到的?这里对 linux 完全陌生=X
【问题讨论】:
-
我看到了同样的事情,并且希望得到一个面向 CMake 的答案。
标签: linux linker-errors undefined-reference