在 Qt Creator 上交叉编译 Qt GUI 应用程序:不兼容的库错误

发布于 2024-12-19 22:31:06 字数 4030 浏览 3 评论 0原文

我正在尝试为 Beaglebord (ARM) 编译 Qt 一段时间并运行一些基本的 Hello Word GUI 应用程序。我已经构建了用于交叉编译的 Qt,并带有下面提到的一些错误和警告,并配置了我的 Qt Creator 以与我的交叉编译工具链一起使用。我已经创建了一个简单的 Qt GUI 项目,但是当我尝试构建我的项目时,我收到以下错误:

:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtGui.so when searching for -lQtGui
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtGui.so when searching for -lQtGui
:-1: error: cannot find -lQtGui
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtNetwork.so when searching for -lQtNetwork
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtNetwork.so when searching for -lQtNetwork
:-1: error: cannot find -lQtNetwork
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtCore.so when searching for -lQtCore
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtCore.so when searching for -lQtCore
:-1: error: cannot find -lQtCore
:-1: error: collect2: ld returned 1 exit status

Alsa 列表项 Qt Creator-> 选项-> Qt4 Qt 版本列表上有一个黄色警告图标:

在此处输入图像描述

我正在使用 Ubuntu 10.10 x86 和最新的 Angstrom 工具链。我使用 Angstrom 在线构建器来构建我的工具链。我已经使用最新的离线 Qt SDK v4.7.4 安装了 Qt Creator。之后,我下载了 Qt 源 qt-everywhere-opensource-src-4.7.4.zip 并配置如下:

将 qws/linux-arm-gnueabi-g++/qmake.conf 更改为:

    #
    # qmake configuration for building with arm-none-linux-gnueabi-g++
    #

    include(../../common/g++.conf)
    include(../../common/linux.conf)
    include(../../common/qws.conf)

    # modifications to g++.conf
    QMAKE_CC                = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-gcc
    QMAKE_CXX               = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-g++
    QMAKE_LINK              = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-g++
    QMAKE_LINK_SHLIB        = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-g++

    # modifications to linux.conf
    QMAKE_AR                = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY           = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-objcopy
    QMAKE_STRIP             = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-strip

    load(qt_config)

使用以下设置配置 Qt:

./configure
    -embedded armv7
    -little-endian
    -xplatform qws/linux-arm-gnueabi-g++
    -qt-gfx-linuxfb
    -qt-gfx-vnc
    -largefile
    -no-accessibility
    -no-qt3support
    -no-sse2
    -qt-libpng
    -qt-libjpeg
    -no-cups
    -no-libtiff
    -nowebkit
    -qt-zlib
    -nomake examples
    -nomake demos
    -opensource
    -confirm-license
    -no-fast
    -multimedia
    -optimized-qmake

这里是我的配置脚本的控制台输出。

正如您在配置输出中看到的那样,只有树警告:

for /home/olcay/qt-everywhere-opensource-src-4.7.4/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro
WARNING: Failure to find: hybridPixmap.cpp
for /home/olcay/qt-everywhere-opensource-src-4.7.4/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro
WARNING: Failure to find: loading.cpp
for /home/olcay/qt-everywhere-opensource-src-4.7.4/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro
WARNING: Failure to find: painting.cpp

此外还有关于浮点格式的警告:

    The system floating point format could not be detected.
    This may cause data to be generated in a wrong format

请帮我找出问题。 提前致谢。

更新1

如果您之前读过这个问题,我已经更改了我的配置并重新编译和安装了Qt,并根据新配置和新结果更新了我的问题。它让我摆脱了 make install 错误,但主要问题仍然没有解决。

更新2

我注意到Qt Creator为linux-g++-32调用qmake而不是qws/linux-arm-gnueabi- g++ 所以我用所需的设置更改了 linux-g++-32/qmake.conf 。现在我可以构建我的应用程序了。但我还没有测试应用程序二进制文件,因为我现在在家。我将测试我的应用程序并明天在此处发布结果。

I am trying to compile Qt for Beaglebord (ARM) for a while and run some basic Hello Word GUI application. I have build Qt for cross compile with some errors and warnings mentioned below and configured my Qt Creator to work with my cross compile tool-chain. And I have created a simple Qt GUI project but when I try to build my project I am getting these errors:

:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtGui.so when searching for -lQtGui
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtGui.so when searching for -lQtGui
:-1: error: cannot find -lQtGui
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtNetwork.so when searching for -lQtNetwork
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtNetwork.so when searching for -lQtNetwork
:-1: error: cannot find -lQtNetwork
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtCore.so when searching for -lQtCore
:-1: error: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.7.4-generic/lib/libQtCore.so when searching for -lQtCore
:-1: error: cannot find -lQtCore
:-1: error: collect2: ld returned 1 exit status

Alsa there is a yellow warning icon on list item Qt Creator->Options->Qt4 Qt Versions list:

enter image description here

I am using Ubuntu 10.10 x86 and latest Angstrom tool-chain. I have used Angstrom online builder to build my tool-chain. I have installed my Qt Creator with lates offline Qt SDK v4.7.4. After that I have downloaded Qt source qt-everywhere-opensource-src-4.7.4.zip and configured as below:

Changed qws/linux-arm-gnueabi-g++/qmake.conf as:

    #
    # qmake configuration for building with arm-none-linux-gnueabi-g++
    #

    include(../../common/g++.conf)
    include(../../common/linux.conf)
    include(../../common/qws.conf)

    # modifications to g++.conf
    QMAKE_CC                = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-gcc
    QMAKE_CXX               = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-g++
    QMAKE_LINK              = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-g++
    QMAKE_LINK_SHLIB        = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-g++

    # modifications to linux.conf
    QMAKE_AR                = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY           = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-objcopy
    QMAKE_STRIP             = /home/olcay/armx86/bin/arm-angstrom-linux-gnueabi-strip

    load(qt_config)

Congigured Qt with following settings:

./configure
    -embedded armv7
    -little-endian
    -xplatform qws/linux-arm-gnueabi-g++
    -qt-gfx-linuxfb
    -qt-gfx-vnc
    -largefile
    -no-accessibility
    -no-qt3support
    -no-sse2
    -qt-libpng
    -qt-libjpeg
    -no-cups
    -no-libtiff
    -nowebkit
    -qt-zlib
    -nomake examples
    -nomake demos
    -opensource
    -confirm-license
    -no-fast
    -multimedia
    -optimized-qmake

Here is my console output for configuration script.

As you can see in configure output there is only tree warnings:

for /home/olcay/qt-everywhere-opensource-src-4.7.4/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro
WARNING: Failure to find: hybridPixmap.cpp
for /home/olcay/qt-everywhere-opensource-src-4.7.4/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro
WARNING: Failure to find: loading.cpp
for /home/olcay/qt-everywhere-opensource-src-4.7.4/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro
WARNING: Failure to find: painting.cpp

Also there is a warning about floating point format:

    The system floating point format could not be detected.
    This may cause data to be generated in a wrong format

Please help me to find out the problem.
Thanks in advance.

UPDATE 1

If you have previously read this question I have changed my configuration and recompiled and installed Qt and updated my question based on new configuration and new results. It provide me to get ride of make install errors but main problem still not solved.

UPDATE 2

I have noticed that Qt Creator calling qmake for linux-g++-32 not for qws/linux-arm-gnueabi-g++ so I changed linux-g++-32/qmake.conf with required settings. Now I am able to build my application. But I have not test application binary yet because I am at home now. I will test my application and post the results here tomorrow.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文