2013-04-27 413 views
5

我已经在CentOS,QT 4.7开发和GCC 4.4链接错误:未定义的参考符号“pthread_rwlock_trywrlock @@ GLIBC_2.2.5”

我刚刚安装红帽开发工具套件1.1,其中包括GCC 4.7 。2,并在make年底,我得到一个错误

/usr/bin/ld: ../../bin/Solo: undefined reference to symbol '[email protected]@GLIBC_2.2.5' 
/usr/bin/ld: note: '[email protected]@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的线程被引用到。我该如何解决它?

+0

您的编译器/链接器的命令行是否包含'-pthread'? – 2013-04-27 22:49:49

回答

14

您是否希望-pthread这并不仅仅是用的libpthread链接编译:

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

3

你只需要添加CONFIG += thread.pro文件。

0

在我的小笔记本电脑的Linux(在那里我有库的混合袋), 我不得不添加

LDFLAGS=-lpthread 

AT的configure命令参数的结尾。

然后,完成它的工作(与现有的库)。

相关问题