I have a project that compiles succesfully in SuseLinux and Debian but it fails in Ubuntu.
The error message in Ubuntu is
undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
[ERROR] /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
I understand the error is produced because -lpthread
is not declared at linking. The project links against rt
,crypto
and other system libraries but pthread
is not explicitly declared.
What I do not understand is why the linking process fails in Ubuntu but not in other Linux systems.
The gcc versions in the systems are:
gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2)
gcc version 4.7.2 (Debian 4.7.2-5)
Could the linking error be produced by gcc 5.x?