ARM的交叉编译:对'__fdelt_chk@GLIBC_2.15'的未定义引用

SBF*_*SBF 2 c++ arm cross-compiling raspberry-pi

按照这个方法,我正在为Raspberry Pi(ARM)交叉编译蓝牙应用程序.当我尝试与libbluetooth链接时,我收到以下错误.即使是最简单的helloworld应用程序(没有蓝牙代码)也不会链接.

arm-linux-gnueabihf-g++ -c hello.cpp -o hello.o
arm-linux-gnueabihf-g++ hello.o -o hello -lbluetooth -L/home/sbf/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf
/home/sbf/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf/libbluetooth.so: undefined reference to `__fdelt_chk@GLIBC_2.15'


sbf@sbf-VirtualBox ~/raspberrypi/projects/test $ ls -al /home/sbf/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf/libbluetooth*
-rw-r--r-- 1 sbf sbf 132886 May 27  2016 /home/sbf/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf/libbluetooth.a
lrwxrwxrwx 1 sbf sbf     23 Nov 24 21:20 /home/sbf/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf/libbluetooth.so -> libbluetooth.so.3.17.11
lrwxrwxrwx 1 sbf sbf     23 Nov 24 21:20 /home/sbf/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf/libbluetooth.so.3 -> libbluetooth.so.3.17.11
-rw-r--r-- 1 sbf sbf 103376 May 27  2016 /home/sbf/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf/libbluetooth.so.3.17.11
Run Code Online (Sandbox Code Playgroud)

编辑(已添加):GLIBC版本2.19

pi@raspberrypi:~ $ ldd --version
ldd (Debian GLIBC 2.19-18+deb8u6) 2.19
Run Code Online (Sandbox Code Playgroud)

出了什么问题?

use*_*838 5

昨天我在尝试使用raspberry pi工具链接libbluetooth时遇到了同样的问题.

为了解决这个问题,我下载了一个比raspberry pi工具库提供的更新版本的Linaro开发工具(6.1.1).

这是最新的linaro工具链发布的链接

下载"gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabihf.tar.xz"并将该文件夹与其他工具链一起放在raspberrypi/tools/arm-bcm2708 /目录中.

然后设置编译器/链接器路径以指向新目录.

(我正在使用cmake)

SET(CMAKE_C_COMPILER $ENV{HOME}/raspberrypi/tools/arm-bcm2708/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc) SET(CMAKE_CXX_COMPILER $ENV{HOME}/raspberrypi/tools/arm-bcm2708/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)

(编辑)由于jessie不支持gcc版本5或6,我在使用此版本的工具链运行我的可执行文件时遇到了麻烦.请尝试使用此版本https://releases.linaro.org/components/toolchain/binaries/4.9 -2016.02/ARM-Linux的gnueabihf /


归档时间:

查看次数:

1852 次

最近记录:

9 年,1 月 前