简体   繁体   English

交叉编译树莓派的QT应用程序-无法打开共享对象文件

[英]Cross-compiling QT apps for a raspberry pi - Cannot open shared object file

I want to be able to use the QT Creator on my full-sized desktop to be able to develop and compile qt apps and deploy them to the pi. 我希望能够在全尺寸桌面上使用QT Creator来开发和编译qt应用并将其部署到pi。

I followed this guide: http://qt-project.org/wiki/Create#QtonPi_App_SDK 我遵循了该指南: http : //qt-project.org/wiki/Create#QtonPi_App_SDK

I am trying to get the hello-qtonpi project to compile. 我正在尝试编译hello-qtonpi项目。 Using the compiler and the toolchain for the pi, I get two errors during compiling: 使用pi的编译器和工具链,在编译期间出现两个错误:

/opt/qtonpi/lib/gcc/armv5tel-qtonpi-linux-gnueabi/4.5.4/../../../../armv5tel-qtonpi-linux-gnueabi/bin/as: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/opt/qtonpi/libexec/gcc/armv5tel-qtonpi-linux-gnueabi/4.5.4/cc1plus: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory

I checked that these two libraries were installed on my pi, and the rsynced /lib and /usr/lib from the pi to my sys-root folder. 我检查了我的pi上是否安装了这两个库,以及从pi到我的sys-root文件夹的rsynced / lib和/ usr / lib。

I tried using the QT Creators Add Library -> System Library tool, and selected eg libz.so, as it didn't show the so.1 one. 我尝试使用QT创建者添加库->系统库工具,并选择了libz.so,因为它没有显示so.1。 It added the following line to the .pro file: 它将以下行添加到.pro文件:

unix:!macx:!symbian: LIBS += -lz

However it still didn't get rid of the error. 但是,它仍然没有消除错误。

How should I include these libraries or tell the compiler where to look from? 我应该如何包括这些库或告诉编译器从哪里看?

Both error messages about libz and libmpc are not related to target libraries missing but to the host part . 有关libz和libmpc的两个错误消息都与缺少的目标库无关,而与主机部分有关

Your cross-compilation toolchain have been built as a dynamic one, so you need to have on your host all libraries resolving dependencies. 您的交叉编译工具链是动态构建的,因此您需要在主机上具有所有解决依赖关系的库。

Since libz.so.1 is quite common,maybe you are running a 64 bit host but your toolchain have been built for 32 bits. 由于libz.so.1非常普遍,因此也许您正在运行64位主机,但是您的工具链已构建为32位。 In this case, you need to find package providing 32 bits version of libz.so.1 and libmpc.so.2. 在这种情况下,您需要找到提供32位版本的libz.so.1和libmpc.so.2的软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM