Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/367.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用其他第三方库与cmake交叉编译 我想用C++编译我的C++应用程序。因此,我在我的ubuntu x86系统上安装了arm-linux-gnueabi-g++软件包。但是,这个包不包含所有需要的第三方库来成功连接我的C++应用程序。例如:_C++_Linux_Cmake_Arm_Cross Compiling - Fatal编程技术网

使用其他第三方库与cmake交叉编译 我想用C++编译我的C++应用程序。因此,我在我的ubuntu x86系统上安装了arm-linux-gnueabi-g++软件包。但是,这个包不包含所有需要的第三方库来成功连接我的C++应用程序。例如:

使用其他第三方库与cmake交叉编译 我想用C++编译我的C++应用程序。因此,我在我的ubuntu x86系统上安装了arm-linux-gnueabi-g++软件包。但是,这个包不包含所有需要的第三方库来成功连接我的C++应用程序。例如:,c++,linux,cmake,arm,cross-compiling,C++,Linux,Cmake,Arm,Cross Compiling,Ubuntu x86系统: 包含基本内容,例如 /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libstdc++.so /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libstdc++.a /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libgcc.a ... 目标系统(ARM): 如果我想直接在arm系统上编译我的应用程序,需要安装更多特定于arm的软件包。因此,可以使用更多的库: /

Ubuntu x86系统: 包含基本内容,例如

/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libstdc++.so
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libstdc++.a
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libgcc.a
...
目标系统(ARM): 如果我想直接在arm系统上编译我的应用程序,需要安装更多特定于arm的软件包。因此,可以使用更多的库:

/usr/lib/libpq.so
/usr/lib/libpq.a
/usr/lib/arm-linux-gnueabi/libssl.so
/usr/lib/arm-linux-gnueabi/libssl.a
/usr/lib/arm-linux-gnueabi/libkrb5.so.3
由于交叉编译需要额外的库,因此我尝试将所需的第三方库从目标系统手动复制到x86系统。但是,由于链接会显示诸如“libssl.so->requires lib B->requires lib C”之类的消息,因此这最终会出现在desaster中


如何在x86系统上使用这些库进行交叉编译?

您可以使用
-Wl
将选项从
g++
传递到链接器。请参阅GNU ld手册中的命令。将其组合为
-Wl,-rpath链接,/lib:/usr/lib
;您可能需要引用,这取决于您如何运行它。类似地,使用
-rpath
设置要在ARM目标上搜索的位置的运行时间。