最近几年,我一直在Pod-1.5.3上运行在odroid上的应用程序。我正在使用arm-linux-gnueabihf-g ++交叉编译器在x86_64机器上编译应用程序。 交叉编译步骤
1. Compiled the poco-1.5.3 code on an odroid.
2. Copied all the libraries and header file present in the /usr/local/lib/, /usr/local/lib/include and /usr/lib/ of odroid in a directory armv7-libs.
3. Created a tar file armv7-libs.tgz
4. Copied these libraries on my x86_64 in path /usr/local/arm_libs/libs-armhf/lib
5. Compiled my application using cross-compiler arm-linux-gnueabihf-g++ by providing compiler option -L/usr/local/arm_libs/libs-armhf/lib
6. Below is the command to compile a file.
1. arm-linux-gnueabihf-g++ -o tests/test_app tests/test_app.o app.o -pedantic -I/usr/local/arm_libs/libs-armhf/include -Darmhf -std=c++11 -Wall -Wno-variadic-macros -g -fPIC -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -fopenmp -O3 -Ofast -L/usr/local/arm_libs/libs-armhf/lib -lPocoFoundation -lPocoNet -lPocoNetSSL -lPocoUtil -lPocoCrypto -ljson -lssl -lcrypto
7. It used to be compile well. And I could runt he tests/test_app on target machine (odroid xu4)
现在我们也要支持arm64,而poco-1.5.3中没有。因此,我们决定将库从poco-1.5.3升级到poco-1.8.1。对于poco-1.8.1库,我执行了与上述相同的步骤。我现在开始面临链接器问题。
1. arm-linux-gnueabihf-g++ -o tests/test_app tests/test_app.o app.o -pedantic -I/usr/local/arm_libs/libs-armhf/include -Darmhf -std=c++11 -Wall -Wno-variadic-macros -g -fPIC -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -fopenmp -O3 -Ofast -L/usr/local/arm_libs/libs-armhf/lib -lPocoFoundation -lPocoNet -lPocoNetSSL -lPocoUtil -lPocoCrypto -ljson -lssl -lcrypto
2. Below are the linker issue which I am facing.
/usr/local/arm_libs/libs-armhf/libPocoCrypto.so: undefined reference to `X509_verify@OPENSSL_1.0.0'
/usr/local/arm_libs/libs-armhf/libPocoNetSSL.so: undefined reference to `SSL_do_handshake@OPENSSL_1.0.0'
/usr/local/arm_libs/libs-armhf/libPocoNetSSL.so: undefined reference to `TLSv1_1_server_method@OPENSSL_1.0.1'
/usr/local/arm_libs/libs-armhf/libPocoCrypto.so: undefined reference to `RSA_private_decrypt@OPENSSL_1.0.0'
我确认openssl库存在于/ usr / local / arm_libs / libs-armhf / lib /
路径中$ ls /usr/local/arm_libs/libs-armhf/lib/ | grep libssl*
libssl.a
libssl.so
libssl.so.1.0.0
$ ls /usr/local/arm_libs/libs-armhf/lib/ | grep libcry*
libcrypto.a
libcrypto.so
libcrypto.so.1.0.0
如果我做错了,请您让我知道。或者需要更改poco-1.8.1库的创建方式。
还是可以请您分享在ubuntu-16.04 x86_86上为armv7l安装工具链的最佳实践吗?我认为此过程不是标准做法,该过程由本机编译第三方库(例如pov,armv7l上的opencv)并在主机(x86_64)上复制以进行交叉编译。请某人分享在ubuntu 16.04上安装armhf工具链的说明以及如何编译该应用程序。