最近在进行specfem3d程序的测试,在make时总是错误,提示“undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'”: 经国内国外多方查询及尝试,最终发现是makefile文件内容错误,现已解决,现将解决方法记录如下。(本人系统为ubuntu16.04) 在进行查询后得知,主要是makefile中的“flags”缺少“-pthread”,国外主要...
仔细想了想了一下,在程序中用到了C++11中的线程std::thread,个人猜测C++11在封装线程std::thread时应当是使用到了pthread,pthread不是linux下的默认的库,也就是在链接的时候,无法找到phread库中线程函数的入口地址,于是链接会失败。 解决方法: 最简单的就是,打开CMakeLists.txt ,在所有用到boost_thread 的后面...
/home/bin/ld: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3' /lib64/libpthread.so.0: error adding symbols: DSO missing from command line 解决办法: 遇到如下错误: .cpp:146: undefined reference to `pthread_key_create' /libboost_thread.a(thread.o): In function `boost...
编译语句 g++-std=c++11main.cpp-lboost_thread 问题 /usr/bin/ld:/tmp/ccgsMvZP.o:undefinedreference to symbol'pthread_condattr_setclock@@GLIBC_2.3.3'/lib/x86_64-linux-gnu/libpthread.so.0:error adding symbols:DSOmissingfromcommand line
/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/ld: Printer.o: undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5' //lib64/libpthread.so.0: error adding symbols: DSO missing from command line ...
On Ubuntu 16.04: I'm getting: [ 36%] Linking CXX executable ../../_bin/standalone/mcfx_convolver_standalone36 /usr/bin/ld: ../../JUCE/libJUCE_STATIC.a(juce_core.cpp.o): undefined reference to symbol 'pthread_setname_np@@GLIBC_2.12' /lib/...
undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' /usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status [87/122] Compiling C++ object mu/mu.p/mu-cmd.cc.o ninja: build stopped: ...
/usr/bin/ld: /tmp/ccMz0hFd.o: undefined reference to symbol ‘pthread_condatt,在linux下,编写C++程序用到了线程库。由于pthread库不是Linux系统默认的库,连接时需要使用库libpthread.a,所以在编译中要加-lpthread参数:g++xxxx.cpp-lpthread-opthread
最近在编写一个程序时(x64 Linux,Arm下没有这个问题),出现了undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'”,明明有设置-pthread(l60870里用到了这个库)。经过测试,有两种解决办法 1、任意一个代码里调用 pthread_create 2、将lpthread放到最后 ...