4

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?

althor
  • 739
  • 2
  • 9
  • 21
  • Possible duplicate of [Strange linking error: DSO missing from command line](https://stackoverflow.com/questions/19901934/strange-linking-error-dso-missing-from-command-line) – perror Jul 18 '17 at 16:40

0 Answers0