Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DSO missing from command line [duplicate]

I am trying to compile a C++ program like this:

$ g++ -o Sniffer_Train main.cpp Sniffer_train.cpp Sniffer_train.h -lmysqlclient -lpcap

However I get the following error:

/usr/bin/ld: /tmp/cct6xeXD.o: undefined reference to symbol
'pthread_join@@GLIBC_2.4' //lib/arm-linux-gnueabihf/libpthread.so.0:
error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status

I have no idea what this error means. Any help will be greatly appreciated.

like image 761
srai Avatar asked Jun 07 '14 11:06

srai


1 Answers

DSO here means Dynamic Shared Object; since the error message says it's missing from the command line, I guess you have to add it to the command line.

That is, try adding -lpthread to your command line.

like image 91
anatolyg Avatar answered Oct 15 '22 18:10

anatolyg