我一直在开发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.