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:
首先,请记住我是linux的新手。我在编译项目时遇到了问题。我一直收到以下错误:
/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
/ usr / bin / ld:CMakeFiles / Robot.dir / source / ModuleHandler.cpp.o:对符号'dlsym @@ GLIBC_2.4'的未定义引用//lib/arm-linux-gnueabihf/libdl.so.2:error添加符号:命令行collect2中缺少DSO:ld返回1退出状态
First off the correct directory is: /usr/lib/arm-linux-gnueabihf/libdl.so
Rather than: //lib/arm-linux-gnueabihf/libdl.so
首先关闭正确的目录是:/usr/lib/arm-linux-gnueabihf/libdl.so而不是://lib/arm-linux-gnueabihf/libdl.so
I've tried updating my ldconfig.conf file, setting LD_LIBRARY_PATH
, using ldd -r
to no avail.
我已经尝试更新我的ldconfig.conf文件,设置LD_LIBRARY_PATH,使用ldd -r无效。
CMAKE is used to create the make file.
CMAKE用于创建make文件。
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.
我以前没有编译问题。它是在我进行apt-get升级或从VS尝试交叉编译之后开始的。
Any suggestions would be greatly appreciated!
任何建议将不胜感激!
//Nathan
1 个解决方案
#1
12
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.
与-ldl链接。
#1
12
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.
与-ldl链接。