[英]Undefined reference to symbol, DSO missing from command line
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.我正在尝试在 Debian Jessie 下编译Lotech 框架,但我似乎无法超越编译中的特定点。 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
For me this does the trick 对我来说,这就是窍门
set (CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl") 设置(CMAKE_CXX_LINK_EXECUTABLE“ $ {CMAKE_CXX_LINK_EXECUTABLE} -ldl”)
Useful links 有用的链接
DSO means Dynamic Shared Object. DSO 表示动态共享 Object。 Add the option "-lpthread" works for me.添加选项“-lpthread”对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.