简体   繁体   English

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

[英]Cross-compile for ARM: undefined reference to '__fdelt_chk@GLIBC_2.15'

Following this howto I'm cross-compiling a bluetooth application for Raspberry Pi (ARM). 按照此方法指南,我将为Raspberry Pi(ARM)交叉编译一个蓝牙应用程序。 When I try to link with libbluetooth I get the error below. 当我尝试与libbluetooth链接时,出现以下错误。 Even the simplest helloworld application (without bluetooth code) won't link. 即使是最简单的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

Edit (added): GLIBC Version 2.19 编辑(添加):GLIBC版本2.19

pi@raspberrypi:~ $ ldd --version
ldd (Debian GLIBC 2.19-18+deb8u6) 2.19

What's going wrong? 怎么了

I was experiencing the same issue yesterday trying to link libbluetooth using raspberry pi tools. 我昨天在尝试使用树莓派工具链接libbluetooth时遇到了同样的问题。

To solve this I downloaded a newer version of Linaro dev tools (6.1.1) than what is supplied by the raspberry pi tools repository. 为了解决这个问题,我下载了比raspberry pi工具存储库提供的版本更高的Linaro开发工具(6.1.1)。

Here is the link to the latest linaro toolchain release 这是最新的linaro工具链版本的链接

Download "gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabihf.tar.xz" and put that folder in your raspberrypi/tools/arm-bcm2708/ directory along with the other toolchains. 下载“ gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabihf.tar.xz”,并将该文件夹与其他工具链一起放在raspberrypi / tools / arm-bcm2708 /目录中。

Then set compiler/linker paths to point to the new directory. 然后设置编译器/链接器路径以指向新目录。

(I am using cmake) (我正在使用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++)

(edit) I had trouble running my executable with this version of the toolchain compiled since jessie doesn't support gcc versions 5 or 6. Instead try using this release https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-linux-gnueabihf/ (编辑)由于jessie不支持gcc版本5或6,我无法在此版本的工具链上运行我的可执行文件。而是尝试使用此版本https://releases.linaro.org/components/toolchain/binaries/4.9 -2016.02 / ARM-Linux的gnueabihf /

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM