Linux下编译Qt源码,一定要下载tar.gz版本,否则会报权限不足

 

首先下载qt-everywhere-opensource-src-4.8.1源码,下载地址:

ftp://ftp.qt-project.org/qt/source/

 

在Linux下编译一定要下载qt-everywhere-opensource-src-4.8.1.tar.gz 不能用qt-everywhere-opensource-src-4.8.1.zip,因为在configure时,会报没有权限和文本编码等错误。

 

编译Qt之前都需要安装tslib,具体安装方法请看:tslib安装

由于配置的命令比较多,我自己写了一个自动安装脚本:

 

[html] view plain copy
 
  1. #!/bin/sh  
  2.   
  3. export PATH=/opt/FriendlyARM/toolschain/4.4.3/bin:$PATH  
  4. export TOOLCHAIN=/opt/FriendlyARM/toolschain/4.4.3  
  5. export TB_CC_PREFIX=arm-linux-  
  6. export PKG_CONFIG_PREFIX=$TOOLCHAIN/arm-none-linux-gnueabi  
  7. export MAKE=/usr/bin/make  
  8. echo "Delect the exist direction"  
  9. rm -rf qt-everywhere-opensource-src-4.8.1  
  10. rm -rf /opt/Qt4.8.1  
  11.   
  12. echo "Unzip qt source"  
  13. tar xzvf qt-everywhere-opensource-src-4.8.1.tar.gz  
  14. cd qt-everywhere-opensource-src-4.8.1  
  15.   
  16. echo "Configure ..."  
  17. #chmod +x configure  
  18. #dos2unix configure  
  19.   
  20.   
  21. ./configure \  
  22. -prefix /opt/Qt4.8.1 \  
  23. -opensource \  
  24. -embedded arm \  
  25. -xplatform qws/linux-arm-g++ \  
  26. -depths 16,18,24,32 \  
  27. -no-glib \  
  28. -no-cups \  
  29. -no-largefile \  
  30. -no-accessibility \  
  31. -no-openssl \  
  32. -no-gtkstyle \  
  33. -no-qt3support \  
  34. -no-phonon \  
  35. -no-webkit \  
  36. -no-libtiff \  
  37. -no-libmng \  
  38. -qt-zlib \  
  39. -qt-libpng \  
  40. -qt-libjpeg \  
  41. -no-nis \  
  42. -no-dbus \  
  43. -little-endian \  
  44. -host-little-endian \  
  45. -qt-freetype \  
  46. -qt-gfx-transformed \  
  47. -qt-gfx-vnc \  
  48. -qt-gfx-linuxfb \  
  49. -qt-gfx-multiscreen \  
  50. -qt-kbd-tty \  
  51. -qt-mouse-tslib \  
  52. -I/usr/local/arm/tslib/include \  
  53. -L/usr/local/arm/tslib/lib \  
  54. 2>&1 | tee conf_log  
  55.   
  56. echo "Make..."  
  57. make 2>&1 | tee make_log  
  58.   
  59. echo "Inatall..."  
  60. make install  

 

http://blog.csdn.net/jecan123/article/details/8760191

posted @ 2016-04-14 05:04  findumars  Views(763)  Comments(0Edit  收藏  举报