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

34,525

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.

Share:
34,525
Nathan
Author by

Nathan

Updated on July 15, 2022

Comments

  • Nathan
    Nathan almost 2 years

    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