Menu

Problems with undefined references

Help
Alaak
2005-11-23
2013-04-22
  • Alaak

    Alaak - 2005-11-23

    Hi, I have the following Problem when compiling the example Test from the cppunit cookbook.

    Invoking: GCC C++ Linker
    g++ -lcppunit -otest.cppunit ./Complex.o ./ComplexNumberTest.o ./main.o
    /usr/lib/gcc/x86_64-linux-gnu/4.0.2/../../../../lib64/libcppunit.so: undefined reference to `dlclose'
    /usr/lib/gcc/x86_64-linux-gnu/4.0.2/../../../../lib64/libcppunit.so: undefined reference to `dlopen'
    /usr/lib/gcc/x86_64-linux-gnu/4.0.2/../../../../lib64/libcppunit.so: undefined reference to `dlsym'

    I do the following compile command:
    g++ -lcppunit -o test.cppunit ComplexNumberTest.o Complex.o main.o

    Does anyone know what the problem is? gcc is in version 4.0.2 on an AMD 64 Architecture.

    Thanks for your help.

     
    • Alaak

      Alaak - 2005-11-23

      Ok, I have found the answer in another forum. Just for the ones who also stumble across this problem: You have to add the library ld. Well, that means additionaly to -lcppunit you have to specify -ldl.

       
      • Code Guru

        Code Guru - 2005-11-23

        Just to clarify you are adding the dl library here, not the ld library.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.