在linux运行math_neon库,linux - 仅使用带交叉编译器的本地库 - 堆栈内存溢出

我正在尝试在linux上使用交叉编译器构建一个应用程序。 应用程序基于OpenEmbedded项目。 编译器和所有交叉编译的库都位于build文件夹中。 但是对于一个包构建脚本试图使用我的linux环境中的库。

最后从make脚本调用的命令:

/ bin / sh ./arm-ABC-linux-gnueabi-libtool --tag = CXX --mode = link arm-ABC-linux-gnueabi-g ++ -march = armv7-a -mtune = cortex-a8 -mfpu = neon -mfloat-abi = softfp -g --std = c ++ 0x -pthread -L / home / ABC / build / sysroots / armv7a-ABC-linux-gnueabi / opt / my / lib -Wl,-rpath-link, / home / ABC / build / sysroots / armv7a-ABC-linux-gnueabi / opt / my / lib -Wl,-O1 -Wl, - hash-style = gnu -L / opt / my / lib -o modbus_server_test modbus_server_test。 o Serial.o SerialUtil.o Crc.o RtuFramer.o Pdu.o SerialMaster.o /home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/usr/local/apr/lib/libapr-2.la - lcrypt -luuid -lrt -lcrypt -lpthread -ldl -lexpat -lstdc ++

从这里最重要的是使用-lexpat标志为libexpat.so.1.5.2库。 这个库是交叉编译的,位于build文件夹中,同时我们的linux环境中有一个库。

结果我收到了下一个错误:

| arm-ABC-linux-gnueabi-libtool:link:arm-ABC-linux-gnueabi -g ++ -march = armv7-a -mtune = cortex-a8 -mfpu = neon -mfloat-abi = softfp -g --std = c ++ 0x -pthread -Wl,-rpath-link -Wl,/ home / ABC / build / sysroots / armv7a-ABC-linux-gnueabi / opt / my / lib -Wl,-O1 -Wl, - hash-style = gnu -o .libs / modbus_server_test modbus_server_test.o Serial.o SerialUtil.o Crc.o RtuFramer.o Pdu.o SerialMaster.o -L / home / ABC / build / sysroots / armv7a-ABC-linux-gnueabi / opt / my / lib -L ​​/ opt / my / lib /usr/local/apr/lib/libapr-2.so -L / home / ABC / build / sysroots / armv7a-ABC-linux-gnueabi / usr / lib / usr / lib / x86_64-linux-gnu / libexpat.so /home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/usr/lib/libuuid.so -lrt -lcrypt -lpthread -ldl / home / ABC / build / sysroots / armv7a-ABC-linux-gnueabi / usr / lib / libexpat.so /home/ABC/build/build/sysroots/armv7a-ABC-linux-gnueabi/usr/lib/libstdc++.so -lm -pthread -Wl, -rpath -Wl,/ usr / local / apr / lib -Wl,-rpath -Wl,/ home / ABC / build / sysroots / armv7a-ABC-linux-gnueabi / usr / lib

| /usr/lib/x86_64-linux-gnu/libexpat.so :文件无法识别:文件格式无法识别

| collect2:ld返回1退出状态| make [2]:*** [modbus_server_test]错误1

从输出我可以看到它包含两个库:一个来自linux环境(/usr/lib/x86_64-linux-gnu/libexpat.so,这是x86),另一个来自build文件夹(build / sysroots / armv7a-ABC-linux) -gnueabi / usr / lib / libexpat.so用于ARM)。最后它抱怨x86类型。

如何在全球环境中排除此库以进行搜索? 为什么甚至试图同时使用它们?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值