c – 链接器错误:对符号’pthread_rwlock_trywrlock @@ GLIBC_2.2.5’的未定义引用

前端之家收集整理的这篇文章主要介绍了c – 链接器错误:对符号’pthread_rwlock_trywrlock @@ GLIBC_2.2.5’的未定义引用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直在开发CentOS,Qt 4.7和GCC 4.4

我刚安装了包含GCC 4.7.2的Red Hat Developer Toolset 1.1,在make结束时,我收到了一个错误

/usr/bin/ld: ../../bin/Solo: undefined reference to symbol 'pthread_rwlock_trywrlock@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pthread_rwlock_trywrlock@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

我猜测Qt线程正在引用它.我该如何解决

解决方法

你想用-pthread编译,它不仅仅是与libpthread链接

Adds support for multithreading with the pthreads library. This option sets flags for both the preprocessor and linker.

原文链接:https://www.f2er.com/c/117295.html

猜你在找的C&C++相关文章