undefined reference to symbol 'dlsym@@GLIBC_2.4'

廉价感情. 提交于 2019-12-09 12:30:19

问题


First off, please keep in mind that I'm new to linux. I'm having problems compiling my project. I keep get the following error:

/usr/bin/ld: CMakeFiles/Robot.dir/source/ModuleHandler.cpp.o: undefined reference to symbol 'dlsym@@GLIBC_2.4' //lib/arm-linux-gnueabihf/libdl.so.2: error adding symbols: DSO missing from command line collect2: ld returned 1 exit status

First off the correct directory is: /usr/lib/arm-linux-gnueabihf/libdl.so Rather than: //lib/arm-linux-gnueabihf/libdl.so

I've tried updating my ldconfig.conf file, setting LD_LIBRARY_PATH, using ldd -r to no avail.

CMAKE is used to create the make file.

I've previously had no problems compiling. It started either when I did a apt-get upgrade or after a tried cross-compiling from VS.

Any suggestions would be greatly appreciated!

//Nathan


回答1:


In general, the man page for the symbol you can't find tells you what libraries you need to link in. In your case:

http://linux.die.net/man/3/dlsym

Note the line:

Link with -ldl.



来源:https://stackoverflow.com/questions/29557683/undefined-reference-to-symbol-dlsymglibc-2-4

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