#693 libtulip-core needs to be linked against libdl

svn version
closed-fixed
5
2013-02-27
2013-02-27
No

libtulip-core is currently not linked against libdl on linux.

Therefore, compiling a standalone application not requiring lidbl like the one enclosed will fail:

$ make
Scanning dependencies of target test
[100%] Building CXX object CMakeFiles/test.dir/test.cpp.o
Linking CXX executable test
/home/cyrille/Dev/Tulip/tulip-trunk/debug/install/lib/libtulip-core-4.2.so: undefined reference to `dladdr'
/home/cyrille/Dev/Tulip/tulip-trunk/debug/install/lib/libtulip-core-4.2.so: undefined reference to `dlopen'
/home/cyrille/Dev/Tulip/tulip-trunk/debug/install/lib/libtulip-core-4.2.so: undefined reference to `dlerror'
/home/cyrille/Dev/Tulip/tulip-trunk/debug/install/lib/libtulip-core-4.2.so: undefined reference to `dlsym'
collect2: ld a retourné 1 code d'état d'exécution
make[2]: *** [test] Erreur 1
make[1]: *** [CMakeFiles/test.dir/all] Erreur 2
make: *** [all] Erreur 2

Modifying library/tulip-core/src/CMakeLists.txt by changing the line:
TARGET_LINK_LIBRARIES(${LibTulipCoreName} gzstream yajl qhull)
to
TARGET_LINK_LIBRARIES(${LibTulipCoreName} gzstream yajl qhull ${CMAKE_DL_LIBS})
solves the problem.

More infos about CMAKE_DL_LIBS:
http://www.cmake.org/cmake/help/v2.8.10/cmake.html#variable:CMAKE_DL_LIBS
http://code.google.com/p/qmmp/issues/detail?id=503

By the way, the application enclosed ends with an ugly:
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'sip' is not defined

Is there a way to prevent this?

Cyrille

Discussion

  • Patrick Mary

    Patrick Mary - 2013-02-27

    Thank you very much for your report.
    This bug is now fixed in the current svn code line.

     
  • Patrick Mary

    Patrick Mary - 2013-02-27
    • status: open --> closed-fixed
     

Log in to post a comment.