2

I'm trying to compile the Lotech framework under Debian Jessie, but I'm can't seem to get past a specific point in compilation. I've searched the error messages that come up, and almost all of them seem to be resolved by installing or linking a missing dependency, but I can't figure out what that dependency is in this situation.

cp buildtmp.linux/liblt.a linux/
cd clients/glfw/ && make LTCFLAGS="-O3 -DNDEBUG -DLTLINUX " && cp ltclient ../../
make[1]: Entering directory `/home/jake/Desktop/copy-lotech-master/clients/glfw'
g++ -O3 -DNDEBUG -DLTLINUX  -I../../linux/include -L../../linux ltclient.cpp \
        -o ltclient -static-libstdc++ -static-libgcc ../../linux/liblt.a ../../linux/libpng.a ../../linux/libz.a ../../linux/liblua.a ../../linux/libvorbis.a ../../linux/libbox2d.a ../../linux/libglfw.a ../../linux/libGLEW.a ../../linux/libopenal.a ../../linux/libcurl.a -lX11 -lGL wrap_memcpy.o -Wl,--wrap=memcpy
/usr/bin/ld: ../../linux/libopenal.a(helpers.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [ltclient] Error 1
make[1]: Leaving directory `/home/jake/Desktop/copy-lotech-master/clients/glfw'
make: *** [ltclient] Error 2
loudaslife
  • 21
  • 1
  • 1
  • 4

2 Answers2

6

For me this does the trick

set (CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl")

Useful links

Link1

Link2

Link3 <- Cmake how to find libraries

Link4

Link5

Community
  • 1
  • 1
Gelldur
  • 11,187
  • 7
  • 57
  • 68
0

DSO means Dynamic Shared Object. Add the option "-lpthread" works for me.

sxu
  • 151
  • 5
  • 1
    when you way "works for me", do you actually mean you reproduced the asker's exact problem scenario and solved it in this way? Or are you referring to a separate problem that you were personally facing? Gelldur's answer involves linking to a DLL-related library, and the asker's error message refers to a DLL-related function. I can't see how libpthread would fix a missing DLL symbol. – starball Sep 05 '22 at 22:17
  • Yes, I got the error message as the asker's. The error was gone after I added "-lpthread" option in linking stage. – sxu Sep 09 '22 at 17:12
  • 2
    Interesting. If you have more insight into why this error occurs and why this fixes it, that would be a great addition to your answer. – starball Sep 09 '22 at 19:56