Qt 4.8.4针对嵌入式Linux的交叉编译因QNetworkProxy错误而失败

时间:2013-03-11 19:08:23

标签: qt cross-compiling embedded-linux qtnetwork qtembedded

我正在尝试使用以下选项交叉编译嵌入式Linux的Qt:

(cd /home/user/proj/output/buildroot/build/company-qt-4.8.4; PKG_CONFIG_SYSROOT_DIR="/home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot" PKG_CONFIG="/home/user/proj/output/buildroot/host/usr/bin/pkg-config" PKG_CONFIG_PATH="/home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/pkgconfig:" MAKEFLAGS="w --  -j8" ./configure -silent -force-pkg-config -separate-debug-info -xplatform qws/linux-arm-gnueabi-g++-company -qconfig company -opensource -confirm-license -largefile -no-qt3support -nomake examples -nomake demos -depths 16,32 -qt-gfx-linuxfb -no-gfx-transformed -no-gfx-qvfb -qt-gfx-vnc -no-gfx-multiscreen -no-gfx-directfb -no-mouse-pc -no-mouse-linuxtp -qt-mouse-linuxinput -qt-mouse-tslib -no-mouse-qvfb -no-kbd-tty -qt-kbd-linuxinput -no-kbd-qvfb -debug -shared -little-endian -embedded arm -no-gif -no-libmng -system-zlib -system-libjpeg -qt-libpng -no-libtiff -system-freetype -I /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/freetype2/ -dbus -qdbus -no-openssl -qt-sql-sqlite -xmlpatterns -exceptions -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -svg -webkit -script -no-scripttools -javascript-jit -stl -declarative -no-pch -glib -no-gfx-qnx -no-kbd-qnx -no-mouse-qnx -no-xinerama -no-cups -no-nis -no-accessibility -prefix /usr -hostprefix /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr -fast -no-rpath )

我真的需要webkit用于嵌入式设备,如果我在配置选项中包含“-webkit”,那么构建最终会失败并带有以下回溯:

../../../../../include/QtCore/../../src/corelib/tools/qlist.h:418:17: error: invalid use of incomplete type ‘class QNetworkProxy’
In file included from ../../../../../include/QtNetwork/qnetworkaccessmanager.h:1:0,
                 from ../../../../../include/QtNetwork/QNetworkAccessManager:1,
                 from platform/network/qt/ProxyServerQt.cpp:32:
../../../../../include/QtNetwork/../../src/network/access/qnetworkaccessmanager.h:62:7: error: forward declaration of ‘class QNetworkProxy’
make[4]: *** [.obj/debug-static-emb-arm/ProxyServerQt.o] Error 1
make[4]: Leaving directory `/home/user/proj/output/buildroot/build/company-qt-4.8.4/src/3rdparty/webkit/Source/WebCore'
make[3]: *** [sub-WebCore-make_default-ordered] Error 2
make[3]: Leaving directory `/home/user/proj/output/buildroot/build/company-qt-4.8.4/src/3rdparty/webkit/Source'
make[2]: *** [sub-webkit-make_default-ordered] Error 2
make[2]: Leaving directory `/home/user/proj/output/buildroot/build/company-qt-4.8.4'
make[1]: *** [/home/user/proj/output/buildroot/build/company-qt-4.8.4/.stamp_built] Error 2
make[1]: Leaving directory `/home/user/proj/buildroot'

如果我只删除“-webkit”选项,那么构建就完成了。

那么为什么我会收到QNetworkProxy错误以及如何解决?谢谢!

编辑:请注意,我还尝试添加以下内容以明确包含QNetworkProxy,但我得到完全相同的错误:

-feature-networkproxy

1 个答案:

答案 0 :(得分:2)

我发现包含的qconfig.h文件具有以下定义:

//Do not need this one
#ifndef QT_NO_NETWORKPROXY
#  define QT_NO_NETWORKPROXY
#endif

这显然是问题所在。