安裝perl
sudo apt install perl
首先轉殖頂級qt 5 git儲存庫
git clone
切換qt分支
cd qt5
git checkout 5.14.1
cd qt5
git checkout 5.14.1
perl init-repository
可以使用./init-repository -help
來檢視幫助
編譯前如果你之前安裝過qt並且設定過環境變數qtdir
,這是沒有關係的,但是你要保證你沒有設定過qmakepath
或者qmakefeatures
,使用命令qmake -query
後輸出中沒有特定的qt版本.有關這只設定的原因請參考下面的鏈結qt文件-qmake配置項 保證$home/.config/trolltech/qmake.conf
目錄檔案為空就好
編譯配置
在qt5同級目錄下建立乙個build目錄,在其中執行
../qt5/configure -debug -developer-build -opensource -nomake examples -nomake tests -platform linux-clang
-developer-build
指定編譯型別
-opensource
設定許可協議為gpl/lgpl
-nomake examples
不編譯示例
-nomake tests
不編譯測試單元
-platform linux-clang
使用clang編譯
編譯過程
執行玩步驟2 後,會有如下輸出
配置後的問題
由於暫時不用webengine
模組, 先不編譯
在當前目錄下執行make -j$(nproc)
即可編譯
$(nproc)
獲取當前cpu核心數
如果使用g++編譯,會出現如下問題,使用clang編譯不會出現
error: unused parameter 『other』 [-werror=unused-parameter]
qtablewidgetselectionrange::qtablewidgetselectionrange(const qtablewidgetselectionrange &other) = default;
解決方法:
在qt5/qtbase/mkspecs/common/g++-base.conf檔案中加入qmake_cxxflags += -wno-unused-parameter
配置qt版本
配置構建套件
官方編譯文件
官方配置選項文件
Qt5 14上應用程式的發布
qt編譯的時候有兩種方式 debug和release,區別就是debug包含了一些除錯資訊,所以生成的檔案相對特別大。release版本最利於發布,所以發布的程式我們採用release版。在qt creator中雙擊helloworld.pro檔案,新增下面一行 rc icons helllo.ic...
ubuntu16啟用daytime服務
1.安裝xinted 先用cat etc services grep daytime 看一下是否有daytime服務,如果沒有的話需要安裝xinted 因為daytime服務包含在xinetd服務中。直接輸入命令 sudo apt get install xinetd 2.修改配置檔案 修改xine...
Window遠端登入Ubuntu16
wget unzip tigervncserver 1.6.80 4 amd64.zip dpkg i tigervncserver 1.6.80 4 amd64.deb 如果安裝出錯可執行 apt get install f 修復依賴關係 安裝 apt get install xrdp y 配置 ...