如何使用Qt应用tiny210设备上? [英] How to use Qt app on tiny210 device?

查看:461
本文介绍了如何使用Qt应用tiny210设备上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Qt的应用程序上 tiny210设备

I want to use a Qt app on a tiny210 device.

我安装了这里 下载的Qt(QT-无处不开源-src.4.8.5)。我设法编译在tiny210使用一个简单的应用。问题是,现在当我尝试在设备上运行应用程序,我得到以下错误:

I installed Qt ( qt-everywhere-opensource-src.4.8.5 ) downloaded from here. I managed to compile a simple application for use on tiny210. The problem is that now when I try to run the app on the device, I get the following errors:

libc.so.6: version 'GLIBC_2.15' not found (required by libQtCore.so.4)
libc.so.6: version 'GLIBC_2.15' not found (required by libQtNetwork.so.4)

有在 / lib中/ 目标设备上的libc.so.6的,但它是2.11版本。

There is a libc.so.6 in /lib/ on the target device, but it is version 2.11.

我要指出,让这些错误之前我也得到了错误的没有 libQtCore.so.4 libQtNetwork.so.4 libQtGui.so.4 。我只是从我的PC主机设备复制编译库修复这些错误。

I should mention that before getting those errors I also got errors for not having libQtCore.so.4, libQtNetwork.so.4 and libQtGui.so.4. I fixed those errors just by copying the compiled libraries from my host PC to the device.

第一个问题是:会出现了一个更好的办法来提供需要的库,或将它们复制细

First question is: Would there have been a better way to provide the needed libraries, or copying them is fine?

第二个问题是:我怎样才能在上面提到的错误

Second question is: How can I get over the errors mentioned above?

编辑:我读过一些关于构建它一成不变的,而是我不知道怎么了,这有什么缺点的。

EDIT : I've read something about building it static, but I am not sure how, and what are the downsides of this.

EDIT2:我管理过上述错误感谢得到的烂漫噪音的的答案,但现在我得到:错误加载共享库:libQtGui.so.4:无法打开共享对象文件:没有这样的文件或目录

EDIT2 : I managed to get over the above errors thanks to artless noise's answer, but now I get: error loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory.

推荐答案

的问题是交叉编译器(的apt-get安装GCC-ARM的Linux的gnueabi )是基于ARM和这个交叉编译器比ARM设备上的一个新的glibc。您可以从交叉编译器目录复制的的libc 的你的ARM设备。我建议用 LD_LIBRARY_PATH测试,更新主库之前。使用 LS /var/lib/dpkg/info/*arm-linux*.list 来看看相关的ARM编译器大多数包。您可以使用的grep 来揣摩出库(或类似票友东西的apt-文件等)。

The issue is the cross-compiler (apt-get install gcc-arm-linux-gnueabi) is ARM based and this cross compiler has a newer glibc than on the ARM device. You can copy the libc from the cross compiler directory to your ARM device. I suggest testing with LD_LIBRARY_PATH, before updating the main libraries. Use ls /var/lib/dpkg/info/*arm-linux*.list to see most packages related to the ARM compiler. You can use grep to figure out where the libraries are (or fancier things like apt-file, etc).

的crosstool-NG具有填充的剧本,但我没有看到它在Ubuntu的软件包;它是完美的您的问题。如果是在您的Debian版本present,我会用它。

Crosstool-ng has a populate script, but I dont see it in the Ubuntu packages; it is perfect for your issue. If it is present on your Debian version, I would use it.

的glibc 的2.15与的的glibc 的2.11这是目前您的系统上向后兼容。可能出现的问题,如果编译器与不同的选项(不同的ABI)配置;但是,如果是这样的话,你将有很多问题与内置的的Qt 的除了库。在这种情况下,你需要找到一个更好的编译器哪个适合您的根文件系统

The glibc 2.15 is backwards compatible with the glibc 2.11 which is currently on your system. Issues may arise if the compiler was configured with different options (different ABI); however if this is the case, you will have many issues with your built Qt besides the library. In this case, you need to find a better compiler which fits your root filesystem.

所以要清楚,对目标

  mkdir /lib/staging
  cp libc.so-2.15 /lib/staging
  cd /lib/staging
  ln -s libc.so-2.15 libc.so
  LD_LIBRARY_PATH=/lib/staging ls  # test the library

您可能需要复制其他库,如的pthread RESOLV RT 地穴的等该文件可能在这样的 SYSROOT / lib目录的目录。您可以将整个目录复制到的 / lib中/分期的对它进行测试。如果上面的 LS 函数,那么编译器应该的 ABI 的兼容。如果你有一个崩溃或不是可执行的,那么编译器和根文件系统可能不兼容。

You may have to copy additional libraries, such as pthread, resolv, rt, crypt, etc. The files are probably in a directory like sysroot/lib. You can copy the whole directory to the /lib/staging to test it. If the above ls functions, then the compilers should be ABI compatible. If you have a crash or not an executable, then the compiler and rootfs may not be compatible.

会不断有更好的方式来提供需要的库,或将它们复制是好的?

Would there have been a better way to provide the needed libraries, or copying them is fine?

复制可能罚款,按照上面。如果不是很好,那么无论是编译器或根文件系统必须被更新。

Copying may be fine as per above. If it is not fine, then either the compiler or the root filesystem must be updated.

我怎样才能在上面提到的错误?

How can I get over the errors mentioned above?

试试上面的方法。同时,您也许能留下您的根文件系统的孤独。建立一个影子目录,<一个href=\"http://stackoverflow.com/questions/18179268/create-a-chroot-jail-and-copy-all-system-files-into-jail\">use 的chroot 运行具有复制的文件作为另一种解决方案中的的Qt 的应用程序。为了验证这一点,做一个非常简单的程序,并把它沿编译器库中的一个测试目录,说的 / lib中/分期的如上。然后测试code可以像运行,

Try the above method. As well, you maybe able to leave your root filesystem alone. Set-up a shadow directory and use chroot to run the Qt application with the copied files as another solution. To test this, make a very simple program and put it along the compiler libraries in a test directory, say /lib/staging as above. Then the test code can be run like,

 $ LD_LIBRARY_PATH=/lib/staging ./hello_world

如果这不起作用,你的编译器和ARM的文件系统/ OS不兼容。没有图书馆的魔法会有所帮助。

If this doesn't work, your compiler and the ARM file system/OS are not compatible. No library magic will help.

我读过一些关于构建它一成不变的,而是我不知道怎么了,这有什么的缺点。

I've read something about building it static, but I am not sure how, and what are the downsides of this.

请参阅 Linux的静态链接是死。我明白这似乎是一个解决方案。但是,如果编译器是错误的,这也无济于事。 OS,图书馆和什么寄存器之间的调用约定由OS保存会在编译code含蓄。您可能必须重建的Qt与 -softfp

See Linux static linking is dead. I understand this seems like a solution. However, if the compiler is wrong, this won't help. The calling convention between OS, libraries and what registers are saved by the OS will be implicit in the compiled code. You may have to rebuild Qt with -softfp, etc.

这篇关于如何使用Qt应用tiny210设备上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆