您的位置:首页 > 编程语言 > Qt开发

ubuntu构建QT4.8.0开发环境

2012-05-30 15:00 387 查看
1.tar zxvf qt-everywhere-opensource-src-4.8.0.tar.gz -C . ,得到qt4.8.0源码文件包,cp -r qt-everywhere-opensource-src-4.8.0/ qt4.8.0-for-arm

2.cd qt-everywhere-opensource-src-4.8.0/,开始配置编译PC版本QT:

(1)./configure

出现"make: g++:命令未找到"错误,解决办法:apt-get install g++

再次运行./configure,出现"Basic XLib functionality test failed!

You might need to modify the include and library search paths by editing

QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /opt/环境搭建/qt-everywhere-opensource-src-4.8.0/mkspecs/linux-g++."错误

解决办法:apt-get install libX11-dev libXext-dev libXtst-dev

(2)make:漫长时间的等待

(3)make install:漫长时间的等待

3.cd qt4.8.0-for-arm/,进入开始编译arm版本QT

(1)./configure -prefix /usr/local/Trolltech/QtEmbedded-4.8.0-arm -embedded arm -xplatform qws/linux-arm-g++ -depths 16,18,24,32 -fast -optimized-qmake -pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -little-endian -host-little-endian
-no-qt3support -no-nis -no-webkit -no-cups -no-glib -no-xcursor -no-xfixes -nomake examples -nomake docs -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib

(2)make

出现错误“lib/libQtGui.so: undefined reference to `ts_read_raw'”

lib/libQtGui.so: undefined reference to `ts_open'

lib/libQtGui.so: undefined reference to `ts_fd'

lib/libQtGui.so: undefined reference to `ts_config'

lib/libQtGui.so: undefined reference to `ts_close'

lib/libQtGui.so: undefined reference to `ts_read'

解决方法:将 mkspecs/common/linux.conf中的QMAKE_LIBS_THREAD变量添加一个参数“-lts”,如下所示,保存后,继续编译:

QMAKE_LIBS_THREAD = -lpthread -lts

(3)make install
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: