Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linux

ldd

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

like image 372
Nathan Avatar asked Apr 10 '15 09:04

Nathan


1 Answers

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.

like image 173
Andrew Henle Avatar answered Oct 27 '22 04:10

Andrew Henle