我的安装环境:
ubuntu12.04,
QT Library: 4.8.1 qt-everywhere-opensource-src-4.8.1.tar.gz
QT Creator:2.4.1 qt-creator-linux-x86-opensource-2.4.1.bin
1. 执行命令:
./configure -prefix /usr/local/qt-4.8.1-for-arm -embedded arm -host-little-endian -no-cups -no-3dnow -nomake examples -nomake demos -nomake docs -xplatform /qws/linux-arm-g++
输出:
.......
The target system byte order could not be detected!
Turn on verbose messaging (-v) to see the final report.
You can use the -little-endian or -big-endian switch to
./configure to continue.
解决办法:加入-little-endian
./configure -prefix /usr/local/qt-4.8.1-for-arm -embedded arm -host-little-endian -little-endian -no-cups -no-3dnow -nomake examples -nomake demos -nomake docs -xplatform /qws/linux-arm-g++
输出:
......
Qt is now configured for building ,just run 'make'
Once everything is built , you must run 'make install'
Qt will be installed into /usr/local/qt-4.8.1-for-arm
To reconfigure ,run 'make confclean' and 'configure'
2. 输入make, 得到下面的错误:
make[1]: arm-linux-g++:命令未找到
make[1]: *** [.obj/release-shared-emb-arm/qabstractanimation.o] 错误 127
make[1]:正在离开目录 `/home/tangys/qt-everywhere-opensource-src-4.8.1/src/corelib'
make: *** [sub-corelib-make_default-ordered] 错误 2
解决办法:-xplatform /qws/linux-arm-g++ 改为 -xplatform /qws/linux-arm-gnueabi-g++
先执行: make confclean ,
然后执行:
./configure -prefix /usr/local/qt-4.8.1-for-arm -embedded arm -host-little-endian-little-endian -no-cups -no-3dnow -nomake examples -nomake demos -nomake docs -xplatform /qws/linux-arm-gnueabi-g++
输出:
Qt is now configured for building ,just run 'make'Once everything is built , you must run 'make install'
Qt will be installed into /usr/local/qt-4.8.1-for-arm
To reconfigure ,run 'make confclean' and 'configure'
3. 执行make
4. 执行make install (需要 sudo make install)
5. 修改环境变量,在~/.bashrc中添加以下语句
export ARMQTDIR=/usr/local/qt-4.8.1-for-arm
export PATH=$ARMQTDIR/bin:$PATH
export LD_LIBRARY_PATH=$ARMQTDIR/lib
export QMAKESPEC=/usr/local/qt-4.8.1-for-arm/mkspecs/qws/linux-arm-gnueabi-g++
重新加载~/.bashrc:
source ~/.bashrc
检查是否成功:
qmake -v
QMake version 2.01a
Using Qt version 4.8.1 in /usr/local/qt-4.8.1-for-arm/lib
which qmake/usr/local/qt-4.8.1-for-arm/bin/qmake