嵌入式linux开发,交叉编译报错:ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)

一、问题描述

在嵌入式linux开发中,进行交叉编译,报错如下

ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
src/PS_Packet_Packaging.o: error adding symbols: File in wrong format
Makefile:52: recipe for target 'libStreamParse.so' failed
make: *** [libStreamParse.so] Error 1

二、问题分析

检查CC、CXX、LD相关的参数的配置,.o文件或交叉编译工具有问题

三、解决方案

个人此处是由于LD参数未给造成的。编译如下

make CC=arm-linux-gcc CXX=arm-linux-g++ LD=arm-linux-ld

[ 3%] Generating dynamic reconfigure files from cfg/Params_PID.cfg: /home/ubuntu/new_workspace/devel/include/simple_follower/Params_PIDConfig.h /home/ubuntu/new_workspace/devel/lib/python2.7/dist-packages/simple_follower/cfg/Params_PIDConfig.py Generating reconfiguration files for Params_PID in simple_follower Wrote header file in /home/ubuntu/new_workspace/devel/include/simple_follower/Params_PIDConfig.h In file included from /home/ubuntu/new_workspace/src/lsx10/lslidar_x10_driver/src/input.cc:18:0: /home/ubuntu/new_workspace/src/lsx10/lslidar_x10_driver/include/lslidar_x10_driver/input.h:35:10: fatal error: lslidar_x10_msgs/LslidarX10Packet.h: No such file or directory #include <lslidar_x10_msgs/LslidarX10Packet.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/build.make:62: recipe for target 'lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/src/input.cc.o' failed make[2]: *** [lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/src/input.cc.o] Error 1 CMakeFiles/Makefile2:10548: recipe for target 'lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/all' failed make[1]: *** [lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... Generating reconfiguration files for params in rplidar_ros Wrote header file in /home/ubuntu/new_workspace/devel/include/rplidar_ros/paramsConfig.h [ 3%] Built target simple_follower_gencfg [ 3%] Built target rplidar_ros_gencfg [ 3%] Linking CXX executable /home/ubuntu/new_workspace/devel/lib/rplidar_ros/rplidarNodeClient [ 3%] Built target rplidarNodeClient Makefile:140: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed
05-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

寞水

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值