當前位置:首頁 » 編程軟體 » qt561源碼編譯

qt561源碼編譯

發布時間: 2023-03-08 06:01:47

㈠ 【求助】QT5.2.1源碼編譯有出錯,提示incomplete type

加上 #include <QApplication>
incomplete type說明當前C++文件中沒有定義QApplication類型,該類型應當在QApplication文件中被定義。,希望以後更細心一點。如果還出錯,檢查pro文件中是否有core和gui模塊。

㈡ Qt下如何編譯庫

一般分為動態庫和靜態庫,方法分別如下:
一.
靜態庫的生成
1.
測試目錄:
lib
2.
源碼文件名:
mywindow.h,
mywindow.cpp
3.
編寫項目文件:
mywindow.pro
注意兩點:
TEMPLATE
=
lib
CONFIG
+=
staticlib
4.
生成Makefile:
qmake
mywindow.pro
5.
編譯生成靜態庫libmywindow.a
make
二.
靜態庫的使用
1.
測試目錄:
test
2.
將mywindow.h與libmywindow.a拷貝至test目錄下
3.
編寫main.cpp,
包含頭文件mywindow.h,
並調用MyWindow類
4.
編寫項目文件:
test.pro
注意加上庫路徑與庫文件名:
LIBS
+=
-L
./
-lmywindow
5.
生成Makefile:
qmake
test.pro
6.
編譯:
make
7.
運行:
./test
三.
動態庫的生成
動態庫編譯基本和靜態庫類似,需要將上述將要進行編譯的項目文件.pro中下面這行去掉
CONFIG
+=
staticlib
按上述操作編譯完後就可以得到以lib開頭並且.so*
結尾動態庫文件,一般有多個。

㈢ 拿到了一份前輩的QT源碼,打算重新編譯一下,出現如下錯誤信息,有大神知道什麼原因,怎麼破解嗎

估計你不滿足他編譯設置條件,錯誤說/MP應該是一個文件或者目錄,但是並不存在

linux下執行qt程序怎麼編譯運行

qmake -project? 已經有.pro文件了! 直接運行qmake或者qmake snake.pro或qmake -makefile snake.pro.

重新解壓,按以下步驟做:
$ qmake
$ make
找到可執行文件(不是.o, 沒後綴的), 一般如果snake.pro中沒設置TARGET,默認生成的可執行文件為snake,輸入
.$ /snake

㈤ 討論上Windows平台怎麼編譯Qt5

Qt5的編譯官方有一篇wiki:http://developer.qt.nokia.com/wiki/Building_Qt_5_from_Git
簡要的總結下我的體會,歡迎補充完善、批評指正。

1.First clone the top-level qt5 git repository:

git clone git://gitorious.org/qt/qt5.git qt5

這一行不用說了,自然是將Qt5的代碼克隆。不過,如果你只是初次克隆Qt5的代碼,會很驚訝:為何克隆後的代碼只有十幾MB?
原來,Qt5已經實現了Qt的模塊化,詳見:http://labs.qt.nokia.com/2011/05/12/qt-moles-maturity-level-the-list/
所以可以在克隆得到的Qt5源碼根目錄下看到:.gitmoles 文件,其內容部分摘錄如下:
[submole "qtbase"]
path = qtbase
url = git://gitorious.org/qt/qtbase.git
[submole "qtsvg"]
path = qtsvg
url = git://gitorious.org/qt/qtsvg.git
[submole "qtdeclarative"]
path = qtdeclarative
url = git://gitorious.org/qt/qtdeclarative.git
...
這時,有Git基礎的朋友一定會想到:
git submole init
git submole update
不過,請不要這樣做!

2. Following the README file we initialize the repository. This clones the various sub-moles of Qt5:
./init-repository

這是一個perl腳本。如果是在msys-git下,會發現Perl的版本不夠。
我們需要安裝一個Windows版本的Perl:http://www.activestate.com/activeperl/downloads
安裝好以後,Perl就添加到PATH環境變數中去了。
在MSVC的控制台下執行:
perl init-repository --help

注意,不是直接執行init-repository,要用perl來執行它。看看幫助:大致了解下有哪些功能。

3. 注意它的三個小提示:
Hint1: If you』re going to contribute to Qt 5, you』ll need to pass the —codereview-username <Jira/Gerrit username> option to set up a 「gerrit」 remote for all the sub-moles.
Hint2: If you』re having problems downloading the webkit repository (which is quite big), you can pass —no-webkit.
Hint3: If you』re behind a firewall, pass —http

4. 我的方法:
perl init-repository -f --codereview-username loaden

這樣就可以實現子模塊的批處理了。特別要注意的是:在處理這些子模塊時,其實是git clone了這些子模塊,以致於他們可以獨立使用。在qt5\qtbase目錄下可以找到.git目錄。
這與git submole update的結果是不一樣的!!
同時我使用了codereview的用戶名,是為了可以創建一個名為gerrit的遠程倉庫,可以將貢獻的代碼推送進去,類似:
git push gerrit HEAD:refs/for/master

5. 源碼下載是非常慢的,因為QtWebkit達到了1.7GB。源碼下載完成後,進入Qt5源碼目錄,配置環境變數:
set PATH=%CD%\qtbase\bin;%PATH%

之後echo看一下結果是否正確:
echo %PATH%

6. 建議直接在Qt5的源碼目錄下執行配置!
configure -confirm-license -opensource -release -shared -platform win32-msvc2010 -fast -no-stl -no-qt3support -nomake examples -nomake demos -nomake tests

7. 編譯全部模塊,直接執行nmake就可以了。如果只編譯一個模塊,可以這樣:
nmake mole-qtbase

雙擊打開Qt5目錄下的Makefile文件,可以看到有這些模塊:
SUBTARGETS = \
mole-qtbase \
mole-qtsvg \
mole-qtphonon \
mole-qtxmlpatterns \
mole-qtdeclarative \
mole-qttools \
mole-qttranslations \
mole-qtdoc \
mole-qlalr \
mole-qtqa \
mole-qtlocation \
mole-qtactiveqt \
mole-qtsensors \
mole-qtsystems \
mole-qtmultimedia \
mole-qtfeedback \
mole-qtquick3d \

mole-qtdocgallery \
mole-qtpim \
mole-qtconnectivity \
mole-qtwayland \
mole-qtjsondb \
sub-qtwebkit-pri \
mole-qtwebkit-examples-and-demos

㈥ qt5.4 源碼編譯安裝問題

在配置的時候加上 -nodbus,希望採納,因為我編譯的時候也遇到了,加上之後就好了。

㈦ ubuntu怎麼編譯qt5源代碼

以下是編譯QT源碼的基本步驟:
1.源代碼的獲取 , 最新的是4.8.2版本。
2.解壓代碼
輸入指令: tar zxvf qt-everywhere-opensource-src-4.8.2.tar.gz,解壓出QT源代碼。
3.執行./config生成makefile
輸入指令: ./config
下面會出現提示,是使用the Commercial Edition還是Open Source Edition。
選擇」o」,接著會出現一些提示關於license的信息,選擇」yes」。

4.編譯QT
等在Ubuntu中順利下載了缺失的那3個lib後。再次重復第三步的 ./configure指令。
輸入指令: make,
然後便可以順利地生成Makefile文件。
5.安裝QT
運行指令: sudo make install,需要幾分鍾的時間,系統會默認將Qt安裝到目錄:/usr/local/Trolltech/Qt-4.8.2。
驗證安裝完成:運行/usr/local/Trolltech/Qt-4.8.2/bin/designer,如果能夠正常啟動designer,則說明Qt已經安裝好了。
6.設置環境變數
7.測試環境變數

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:741
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:1005
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:712
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:874
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:773
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1120
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:346
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:224
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:910
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:869