本文主要是介绍【tx2】——动态库编译注意事项,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1. 在ubuntu上编译成库,然后把库so直接copy到tx2用于编译
可能问题:
- ubuntu上编译的库在tx2上(arm平台上)能否直接使用?
结果:
/usr/bin/ld: skipping incompatible /home/ginger/chenjun/libs_make/lib/libmegengine.so when searching for -lmegengine
/usr/bin/ld: cannot find -lmegengine
collect2: error: ld returned 1 exit status
example/CMakeFiles/segDemo.dir/build.make:111: recipe for target '../segDemo' failed
make[2]: *** [../segDemo] Error 1
CMakeFiles/Makefile2:124: recipe for target 'example/CMakeFiles/segDemo.dir/all' failed
make[1]: *** [example/CMakeFiles/segDemo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: skipping incompatible /home/ginger/chenjun/libs_make/lib/libmegengine.so when searching for -lmegengine
/usr/bin/ld: cannot find -lmegengine
collect2: error: ld returned 1 exit status
example/CMakeFiles/buildEngine.dir/build.make:111: recipe for target '../buildEngine' failed
make[2]: *** [../buildEngine] Error 1
CMakeFiles/Makefile2:87: recipe for target 'example/CMakeFiles/buildEngine.dir/all' failed
make[1]: *** [example/CMakeFiles/buildEngine.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
ubuntu上编译的库so不能直接给arm平台使用,需要在arm平台上重新编译so库
2. 在arm平台上重新编译so库
结果:
直接编译通过
[ 25%] Linking CXX executable ../../segDemo
[ 50%] Linking CXX executable ../../buildEngine
[ 75%] Built target buildEngine
[100%] Built target segDemo
这篇关于【tx2】——动态库编译注意事项的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!