I try to cross compile host computer and Jetson Xavier, made by matlab coder

3 次查看(过去 30 天)
I try to compile c++ code generated by matlab coder on Jetson Xavier, ROS, using cmake.
I success generating c++ code without ploblem.
but I got a ploblem when compilingg on Xavier. I think error occured beacause of cross compile.
when I generate c++ code by matlab coder, select option nvidia jetson and GNU linux64bit and static library (.a)
I need your help
Thanks.
below is error code
/usr/bin/ld: /home/nvidia/catkin_ws/src/realtime_inpainting/src/wrapper/wrapper.a(wrapper.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/nvidia/catkin_ws/src/realtime_inpainting/src/wrapper/wrapper.a(wrapper.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/nvidia/catkin_ws/src/realtime_inpainting/src/wrapper/wrapper.a(wrapper.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/nvidia/catkin_ws/src/realtime_inpainting/src/wrapper/wrapper.a(wrapper.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/nvidia/catkin_ws/src/realtime_inpainting/src/wrapper/wrapper.a(wrapper.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/nvidia/catkin_ws/src/realtime_inpainting/src/wrapper/wrapper.a(wrapper.o): Relocations in generic ELF (EM: 62)
/home/nvidia/catkin_ws/src/realtime_inpainting/src/wrapper/wrapper.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
realtime_inpainting/CMakeFiles/inpainting_cuda.dir/build.make:131: recipe for target '/home/nvidia/catkin_ws/devel/lib/realtime_inpainting/inpainting_cuda' failed
make[2]: *** [/home/nvidia/catkin_ws/devel/lib/realtime_inpainting/inpainting_cuda] Error 1
CMakeFiles/Makefile2:7310: recipe for target 'realtime_inpainting/CMakeFiles/inpainting_cuda.dir/all' failed
make[1]: *** [realtime_inpainting/CMakeFiles/inpainting_cuda.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
  2 个评论
David Fink
David Fink 2020-5-4
Based on some forums with the same error, it seems like the compiler and linker are building for different architectures, so the linker isn't very happy with the object files the compiler produced.
If you're building for Jetson, don't you need to use nvcc as the linker instead of usr/bin/ld?
Ramakrishna Mandalapu
Hi DaHoon,
Could you please give some more info on the settings you did in the model? I am little confused about the option GNU linux64bit, where did you set this option?
Thanks,
Ramakrishna

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by