DSO missing from command line

匿名 (未验证) 提交于 2019-12-03 01:23:02

问题:

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.

回答1:

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.



回答2:

I also encountered a similar problem, after the settlement, a library that needs to be connected.
But in fact, you may have forgotten to connect the library.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!