undefined reference to symbol 'pthread_sigmask@@GLIBC_2.2.5' 解决方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/DONGHUIB/article/details/82824011

/usr/bin/ld: CMakeFiles/xxxx/yyyyy.cpp.o: undefined reference to symbol 'pthread_sigmask@@GLIBC_2.2.5'
//usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

原因:

CMakeList.txt 错误

find_package(Threads REQUIRED)

之后少写了链接库位置

target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
 


 

猜你喜欢

转载自blog.csdn.net/DONGHUIB/article/details/82824011