2013-04-27 31 views
5

byłem rozwijających CentOS, Qt 4.7, a GCC 4.4Linker error: niezdefiniowane odniesienia do symbolu 'pthread_rwlock_trywrlock @@ GLIBC_2.2.5'

Właśnie zainstalowany Red Hat Developer Toolset 1.1, który zawiera GCC 4.7 0,2, a na koniec make, pojawia się błąd

/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 

Zgaduję, że Qt wątki odwołuje się do tego. Jak mogę to naprawić?

+0

Czy wiersz polecenia kompilatora/łącznika zawiera '-pthread'? –

Odpowiedz

14

chcesz skompilować z -pthread który robi więcej niż tylko połączyć z libpthread:

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

0

W moim małym laptopie Linux (gdzie mam mieszane worek bibliotek), po prostu musiałem dodać

LDFLAGS=-lpthread 

na koniec argumentów polecenia configure.

Po tym, wykonaj swoją pracę doskonale (z istniejącymi bibliotekami).

Powiązane problemy