链接到特定的GLIBC版本
Link with specific GLIBC version
我正在使用一台带有交叉编译程序的远程主机,以便构建和部署cpp代码到BeagleBone Black。我的问题是,由于我试图用<time.h>
函数运行我的代码,我得到了一条消息:
/lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.17' not found (required by /home/debian/app)
所以我用ldd --version
检查了我在BBB上得到的版本,得到了:
ldd (Debian EGLIBC 2.13-38+deb7u8) 2.13
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
有没有办法告诉我的交叉编译程序在链接时使用GLIBC 2.13版本而不是2.17?很少有研究向我提供信息,在BBB上更新GLIBC不是一个简单的解决方案,所以我想知道这种方法。我会感谢所有的帮助。
经过大量实验,我发现了这个解决方案。可以在Beaglebone Black上将libc版本更新到2.17。首先从以下位置下载libc6_2.17-ubuntu5_armhf.deb(用于使用硬浮点进行编译)或libc6-armel_2.17-uubuntu5.1_armhf.debhttps://launchpad.net/ubuntu/raring/armhf/libc6/2.17-0ubuntu5或https://launchpad.net/ubuntu/raring/armhf/libc6-armel/2.17-0ubuntu5.1分别地
接下来,使用scp将文件复制到BBB。
scp libc6_2.17-0ubuntu5_armhf.deb root@beaglebone.local:/root
scp libc6-armel_2.17-0ubuntu5.1_armhf.deb root@beaglebone.local:/root
最后,安装软件包。
sudo dpkg --install libc6_2.17-0ubuntu5_armhf.deb
sudo dpkg --install libc6-armel_2.17-0ubuntu5.1_armhf.deb
它适用于我的设备上需要新版本的功能,尽管ldd --version
仍显示为2.13。您还可以考虑使用sudo apt-get -f install
来摆脱旧版本。
希望它能有所帮助!
相关文章:
- 为cl.exe(Visual Studio代码)指定命令行C++版本
- 导入库可以跨dll版本工作吗
- 在调用FreeLibrary后,释放动态链接到具有相同版本的CRT堆的DLL的内存
- 在clang++预处理器中确定gcc工具链版本
- 码头化的C++应用程序是否向后兼容早期的内核版本
- 不同的Visual Studio版本中缺少.dll
- 用符号版本替换对函数的所有调用
- luaL_dofile在已知良好的字节码上失败,可以使用未编译的版本
- 正在解码MSVC 32位版本的程序集(作业).没有手术做什么
- glibc 版本比 gcc 版本和 -wl,-rpath 不工作
- libstdc++.so 在使用 Patchelf 和备用 glibc 版本时找不到
- 发布我的 *.so文件时,应使用哪个版本的glibc
- glibc(或libc6)库版本
- 检测旧GLIBC版本的堆栈溢出
- Glibc 版本不匹配
- 在使用旧版本gcc / glibc / libstdc++的计算机上运行用gcc 4.7编译的c++ 11可执行文件的问
- 在GLIBC版本较低的目标系统上,从.so文件导入Python模块失败
- 链接到特定的GLIBC版本
- 在不同版本的Linux和glibc上构建和运行c++代码
- 从Java调用c++,但是Java加载了错误的Glibc版本