【问题标题】:Error during arm-linux-gnueabihf-g++ cross compile. Shared library file not recognizedarm-linux-gnueabihf-g++ 交叉编译时出错。无法识别共享库文件
【发布时间】:2019-01-08 11:30:41
【问题描述】:

我正在尝试使用此处https://www.acmesystems.it/arm9_toolchain 的 ARM 交叉编译器工具链为 64 位架构 arm 设备交叉编译 c++ 代码。

我的编译命令是

arm-linux-gnueabihf-gcc examples/neon_cartoon_effect.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L/home/deeptihegde/ComputeLibrary/build  -larm_compute -o build/neon_cartoon_effect

我收到以下错误

/home/deeptihegde/ComputeLibrary/build/libarm_compute.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

。 这是编译器问题吗?我链接不正确吗? 任何帮助将不胜感激,谢谢。

【问题讨论】:

  • 如果你运行file /home/deeptihegde/ComputeLibrary/build/libarm_compute.so,它会说什么?该库是否也被交叉编译?
  • 它给出了这个:/home/deeptihegde/ComputeLibrary/build/libarm_compute.so:ELF 64 位 LSB 共享对象,ARM aarch64,版本 1 (GNU/Linux),动态链接,BuildID[sha1 ]=779ad964649f926da1ee4d2d834c37d8259f85af,未剥离
  • @Someprogrammerdude ,将编译器更改为 64 位 arm 编译器是否可行?
  • 考虑到您的目标是 64 位平台,并且库是为 64 位目标构建的,那么是的,这可能是一个好主意。
  • 好的,我使用 g++-aarch64-linux-gnu 工具链编译。现在,我收到 -mpfu=neon 标签的错误。当我在没有它的情况下编译时,所有使用 NEON 的地方都会抛出错误。任何其他建议的编译器?我是否从源代码构建编译器是否重要?

标签: c++ compiler-errors g++ shared-libraries cross-compiling


【解决方案1】:

我认为问题在于您正在尝试将 32 位应用程序(neon_cartoon_effect)与 64 位库(libarm_compute.so)链接。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-04
    • 1970-01-01
    • 1970-01-01
    • 2014-09-26
    • 2019-09-28
    • 2017-10-23
    • 2014-03-14
    • 1970-01-01
    相关资源
    最近更新 更多