Qt4.8.5 開發環境搭建沒有生成makefile文件【編譯出現的問題】


  1. 安裝 Qt 過程中 沒有生成makefile文件

yechuang@yechuang:~/Qt$ sudo apt-get install libX11-dev libXext-dev libXtst-dev

正在讀取軟件包列表... 完成
正在分析軟件包的依賴關系樹      
正在讀取狀態信息... 完成      
將會安裝下列額外的軟件包:
  libpthread-stubs0 libpthread-stubs0-dev libx11-6 libx11-dev libxau-dev
  libxcb1 libxcb1-dev libxdmcp-dev libxext-dev libxext6 libxi-dev libxi6
  libxtst-dev libxtst6 x11proto-core-dev x11proto-input-dev x11proto-kb-dev
  x11proto-record-dev x11proto-xext-dev xtrans-dev
下列【新】軟件包將被安裝:
  libpthread-stubs0 libpthread-stubs0-dev libx11-dev libxau-dev libxcb1-dev
  libxdmcp-dev libxext-dev libxi-dev libxtst-dev x11proto-core-dev
  x11proto-input-dev x11proto-kb-dev x11proto-record-dev x11proto-xext-dev
  xtrans-dev
下列軟件包將被升級:
  libx11-6 libxcb1 libxext6 libxi6 libxtst6
升級了 5 個軟件包,新安裝了 15 個軟件包,要卸載 0 個軟件包,有 537 個軟件包未被升級。
需要下載 5,152kB 的軟件包。
解壓縮后會消耗掉 8,958kB 的額外空間。
您希望繼續執行嗎?[Y/n]
【警告】:下列軟件包不能通過驗證!
  libxcb1 libx11-6 x11proto-core-dev libxau-dev libxdmcp-dev
  x11proto-input-dev x11proto-kb-dev xtrans-dev libpthread-stubs0
  libpthread-stubs0-dev libxcb1-dev libx11-dev libxext6 x11proto-xext-dev
  libxext-dev libxi6 libxi-dev libxtst6 x11proto-record-dev libxtst-dev
不經驗證就安裝這些軟件包嗎?[y/N]
E: 有些軟件包不能通過驗證

  • 進入剛剛解壓的 qt 源碼目錄中:cd qt-everywhere-opensource-src-4.8.5/; 執行./configure, 出現如下圖所
    示,選擇開源版本
yechuang@yechuang:~/Qt/qt-everywhere-opensource-src-4.8.5$ ./configure
Which edition of Qt do you want to use ?

Type 'c' if you want to use the Commercial Edition.
Type 'o' if you want to use the Open Source Edition.

o


This is the  Open Source Edition.

You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.

Type '3' to view the GNU General Public License version 3.
Type 'L' to view the Lesser GNU General Public License version 2.1.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.

Do you accept the terms of either license? yes
……………………
 
g++ -o "/home/yechuang/Qt/qt-everywhere-opensource-src-4.8.5/bin/qmake" project.o property.o main.o makefile.o unixmake2.o unixmake.o mingw_make.o option.o winmakefile.o projectgenerator.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o gbuild.o qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfile.o qfilesystementry.o qfilesystemengine_unix.o qfilesystemengine.o qfilesystemiterator_unix.o qfsfileengine_unix.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlocale_unix.o qlinkedlist.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o  
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 /home/yechuang/Qt/qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++.
 
編譯之后執行$make 沒有出現makefile,檢查其原因,考慮是上一步sudo apt-get install libX11-dev libXext-dev libXtst-dev安裝的問題,不能用回車來選擇一些選項,這里不要偷工減料咯,重新安裝編譯執行:
$ sudo apt-get install libX11-dev libXext-dev libXtst-dev
…………現象
正在設置 x11proto-xext-dev (7.1.1-2) ...
正在設置 libxext-dev (2:1.1.1-2ubuntu0.1) ...
正在設置 libxi6 (2:1.3-3ubuntu0.2) ...

正在設置 libxi-dev (2:1.3-3ubuntu0.2) ...
正在設置 libxtst6 (2:1.1.0-2ubuntu0.1) ...

正在設置 x11proto-record-dev (1.14-2) ...
正在設置 libxtst-dev (2:1.1.0-2ubuntu0.1) ...
正在處理用於 libc-bin 的觸發器...
ldconfig deferred processing now taking place
可能這就是編譯成功了吧,再次重新編譯源碼。
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/Trolltech/Qt-4.8.5

To reconfigure, run 'make confclean' and 'configure'.

yechuang@yechuang:~/Qt/qt-everywhere-opensource-src-4.8.5$ ls
bin              configure.exe  INSTALL             Makefile      src
changes-4.8.5    demos          LGPL_EXCEPTION.txt  mkspecs       templates
config.profiles  doc            lib                 plugins       tools
config.status    examples       LICENSE.FDL         projects.pro  translations
config.tests     imports        LICENSE.GPL3        qmake         util
configure        include        LICENSE.LGPL        README

在這里就看出了已經生成了makefile了,執行

yechuang@yechuang:~/Qt/qt-everywhere-opensource-src-4.8.5$ make

2.上找不到qmake的解決辦法

tangbin@ubuntu:/usr/local/Trolltech/QtEmbedded-4.8.5-arm/bin$ gedit /etc/profile
添加環境變量。
 

或者

root@yechuang:/usr/local/Trolltech/Qt-4.8.5/bin# sudo ./qmake -v
QMake version 2.01a
Using Qt version 4.8.5 in /usr/local/Trolltech/Qt-4.8.5/lib


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM