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

时间:2011-12-06 14:20:52

标签: qt4 arm qt-creator cross-compiling beagleboard

我正在尝试为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版本列表:

enter image description here

我正在使用Ubuntu 10.10 x86和最新的Angstrom工具链。我使用Angstrom在线构建器来构建我的工具链。我安装了我的Qt Creator,配备了离线Qt SDK v4.7.4。之后我下载了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

Here是配置脚本的控制台输出。

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

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。现在我可以构建我的应用程序了。但我还没有测试应用程序二进制文件,因为我现在在家。我将测试我的申请并明天将结果公布在这里。

1 个答案:

答案 0 :(得分:1)

您使用的是错误的qconf文件。 QtCreater默认使用linux-g ++ - 32 / qmake.conf。 将所需更改为此文件。