青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 54, comments - 32, trackbacks - 0, articles - 0

Qt5.10.1 static compiling on Windows MSVC/Ubuntu g++

Posted on 2019-03-08 11:00 宋鵬 閱讀(1665) 評論(0)  編輯 收藏 引用 所屬分類: Qt

環(huán)境:Windows10 / vs2013 or vs2015(Qt5.10.1是以C++11為基礎(chǔ),因此vs2008歇菜了)

參考代碼里的Readme:

1.安裝:
安裝了perl/python2.7/ruby 
安裝了vs2015

2.環(huán)境變量
add C:\Perl\bin to PERL_HOME
add %PERL_HOME% to path
add C:\Python27 to PYTHON_HOME
add %PYTHON_HOME% to path
add C:\Ruby26\bin to RUBY_HOME
add %RUBY_HOME% to path
add C:\Qt\Qt5.10.1\5.10.1\msvc2015\bin to QT_LIB_HOME
add %QT_LIB_HOME% to path
add C:\Qt\Qt5.10.1\Tools\QtCreator\bin to QT_CREATOR_HOME
add %QT_CREATOR_HOME% to path
注意:像官方推薦的一樣,這里最好用同一版本的binary安裝的Qt比較安裝。
注意:如果這里沒有添加QT的路徑,就會(huì)被推薦用nmake編譯,否則被推薦用jom編譯。
3.代碼:
代碼解壓縮到C:\Qt\Qt5.10.1_src
于是Configure文件在:
C:\Qt\Qt5.10.1_src

qtbase文件夾在:
C:\Qt\Qt5.10.1_src\qtbase

4.修改配置從MD到MT(動(dòng)態(tài)鏈接改為靜態(tài)鏈接):
修改文件:
C:\Qt\Qt5.10.1_src\qtbase\mkspecs\common\msvc-desktop.conf
修改下面幾行代碼:
QMAKE_CFLAGS_RELEASE    = $$QMAKE_CFLAGS_OPTIMIZE -MD
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MD
QMAKE_CFLAGS_DEBUG      = -Zi -MDd
改為:
QMAKE_CFLAGS_RELEASE    = $$QMAKE_CFLAGS_OPTIMIZE -MT
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MT
QMAKE_CFLAGS_DEBUG      = -Zi -MTd

修改文件:
C:\Qt\Qt5.10.1_src\qtbase\mkspecs\common\msvc-version.conf
在最前面加上:
QMAKE_MSC_VER = 1900
否則會(huì)報(bào)錯(cuò):
msvc-version.conf loaded but qmake_msc_ver isn't set

運(yùn)行C:\Qt\Qt5.10.1_src>configure.bat 確認(rèn)配置
5.編譯:
<license>選擇-opensource
控制臺(tái)選擇:
開始 -> Visual Studio 2015 -> Developer Command Prompt for VS2015 
編譯選擇
 -skip <repo> ......... Exclude an entire repository from the build.
Ex:
-skip qtwebengine
C:\Qt\Qt5.10.1_src\qtwebengine
-nomake <part> ....... Exclude <part> from the list of parts to be built.
Ex:
-nomake tools -nomake examples -nomake tests
C:\Qt\Qt5.10.1_src\qtbase\tests
-make <part> ......... Add <part> to the list of parts to be built.
                                Specifying this option clears the default list first.
                                [libs and examples, also tools if not cross-building,
                                also tests if -developer-build]
-make libs -qt-zlib -qt-pcre -qt-libpng
Ex:
C:\Qt\Qt5.10.1_src\qtbase\src\3rdparty\zlib

瘋狂的縮減編譯選擇,可以用來嘗試最小化編譯,當(dāng)然我失敗了( comercial user 可以用qt的Congiguration tool 然而我并沒有,有些以來無法zh)
configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_static"  -make libs -nomake tools -nomake examples -nomake tests -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns -no-feature-texthtmlparser -no-feature-textodfwriter -no-feature-concurrent -no-feature-effects -no-feature-sharedmemory -no-feature-systemsemaphore -no-feature-im -no-feature-process -no-feature-dom -no-feature-filesystemmodel -no-feature-filesystemwatcher -no-feature-graphicsview -no-feature-graphicseffect -no-feature-sizegrip -no-feature-calendarwidget -no-feature-printpreviewwidget -no-feature-keysequenceedit -no-feature-colordialog -no-feature-filedialog -no-feature-fontdialog -no-feature-printpreviewdialog -no-feature-progressdialog -no-feature-inputdialog -no-feature-errormessage -no-feature-wizard -no-feature-datawidgetmapper -no-feature-imageformat_bmp -no-feature-imageformat_ppm -no-feature-imageformat_xbm -no-feature-imageformat_png -no-feature-imageformat_jpeg -no-feature-image_heuristic_mask -no-feature-image_text -no-feature-colornames -no-feature-cups -no-feature-paint_debug -no-feature-freetype -no-feature-translation -no-feature-codecs -no-feature-big_codecs -no-feature-iconv -no-feature-ftp -no-feature-udpsocket -no-feature-networkproxy -no-feature-socks5 -no-feature-networkdiskcache -no-feature-bearermanagement -no-feature-completer -no-feature-fscompleter -no-feature-desktopservices -no-feature-mimetype -no-feature-systemtrayicon -no-feature-undocommand -no-feature-undostack -no-feature-undogroup -no-feature-undoview -no-feature-statemachine -no-feature-gestures -no-feature-dbus -no-opengl 

成功的組合1(想編譯哪個(gè) 就去掉哪個(gè)skip):
configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -nomake tools -nomake examples -nomake tests -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns -no-opengl 
嘗試2:
configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwinextras -skip qtx11extras  -no-openssl 
Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
結(jié)果:
Static builds of QtWebEngine aren't supported.
"Some of the required modules (android|ios|winrt|qtHaveModule(webengine)) are not available."
skip webengine 繼續(xù)測試:
configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -skip qtx11extras  -no-openssl 
結(jié)果:
成功

成功的組合2:
configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -skip qtx11extras  -no-openssl 
成功的組合1只是在單獨(dú)編譯qtbase時(shí)有用,于是以后采用的成功的組合2,總結(jié)命令為:
cd C:\Qt\Qt5.10.1_src
configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -skip qtx11extras  -no-openssl 
jom -j2
jom install

plus1:
WARNING: Using OpenGL ES 2.0 on Windows without ANGLE.
The build will most likely fail.
Specify -opengl desktop to use regular OpenGL.

plus2:
-skip qtwebengine , 都是Linux only
Webengine options:
  -webengine-alsa ................ Enable ALSA support [auto] (Linux only)
  -webengine-pulseaudio .......... Enable PulseAudio support [auto]
                                   (Linux only)
  -webengine-embedded-build ...... Enable Linux embedded build [auto]
                                   (Linux only)
  -webengine-icu ................. Use system ICU libraries [system/qt]
                                   (Linux only)

plus3:
Static builds of QtWebEngine aren't supported.

環(huán)境:Ubuntu 18.10/linux g++


1.安裝:

安裝了perl/python/ruby ( Linux 中 python2.x 的名字是python python3.x的名字是python3 )
統(tǒng)一安裝:

sudo apt-get install build-essential libpcap0.8-dev libx11-dev libfreetype6-dev libavahi-gobject-dev libsm-dev libxrender-dev perl python ruby


2.環(huán)境變量:
linux的環(huán)境變量 只要不是特殊安裝的,應(yīng)該都被包含在內(nèi)了

3.代碼:
同上

4.動(dòng)態(tài)鏈接改為靜態(tài)鏈接:
linux沒有md/mt,編譯都時(shí)候 直接-static應(yīng)該就可以。

5.編譯:
嘗試的組合1:
./configure -confirm-license -opensource -static -debug-and-release -prefix "/home/peng/Share/Qt5.10.1_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -no-openssl 
編譯出錯(cuò)
qfilesystemengine_unix.cpp:101:12: error: ‘int renameat2(int, const char*, int, const char*, unsigned int)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
bug fix:
這是跟glibc2.28有關(guān)的bug。。由于原來的patch已經(jīng)對不上號,所以切換到5.10 或者5.11

嘗試的組合2(in qt 5.11):
./configure -confirm-license -opensource -static -debug-and-release -prefix "/home/peng/Share/Qt5.10.1_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -no-openssl 
configure執(zhí)行出錯(cuò):
WARNING: -debug-and-release is only supported on Darwin and Windows platforms.  Qt can be built in release mode with separate debug information, so -debug-and-release is no longer necessary.
ERROR: Feature 'debug_and_release' was enabled, but the pre-condition 'config.darwin || config.win32' failed.
嘗試的組合3(in qt 5.11):
./configure -confirm-license -opensource -static -force-debug-info -prefix "/home/peng/Share/Qt5.11_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -no-openssl 
編譯出錯(cuò)
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
make[3]: *** [Makefile:135: ../../bin/qml] Error 1
make[3]: Leaving directory '/home/peng/qt5/qt5/qtdeclarative/tools/qml'
make[2]: *** [Makefile:155: sub-qml-make_first] Error 2
make[2]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/peng/qt5/qt5/qtdeclarative/tools/qmlpreview'
make[2]: Leaving directory '/home/peng/qt5/qt5/qtdeclarative/tools'
make[1]: *** [Makefile:75: sub-tools-make_first] Error 2
make[1]: Leaving directory '/home/peng/qt5/qt5/qtdeclarative'
make: *** [Makefile:159: module-qtdeclarative-make_first] Error 2

嘗試的組合4(成功的組合)(in qt 5.11):
./configure -confirm-license -opensource -static -force-debug-info -prefix "/home/peng/Share/Qt5.11_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -skip qtdeclarative  -no-openssl 
make -j2
make install
結(jié)果:
成功。

5.10.1的關(guān)于glibc的renameat的bug,被官方在5.11的branch里修復(fù)如下:
commit 25feee4e061b99edab79503d81f5bd045c6c8e3d
Author: Thiago Macieira <thiago.macieira@intel.com>
Date:   Tue Aug 7 09:38:42 2018 -0700
    Fix qmake build with glibc 2.28
    
    We haven't yet run the configure checks to see if statx and renameat2
    are present in glibc, so this fails when we redefine the structures and
    functions.
    
    linux/stat.h:56:8: error: redefinition of 'struct statx_timestamp'
    bits/statx.h:25:8: note: previous definition of 'struct statx_timestamp'
    qfilesystemengine_unix.cpp:110:12: error: 'int renameat2(int, const char*, int, const char*, unsigned int)' was declared 'extern' and later 'static' [-fpermissive]
    
    Change-Id: Ia741b559c24d46c78fb2fffd1548a792d22e3368
    Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
    Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>

環(huán)境:Ubuntu 18.04/交叉編譯 arm


1.安裝:

安裝了perl/python/ruby ( Linux 中 python2.x 的名字是python python3.x的名字是python3 )
統(tǒng)一安裝:

sudo apt-get install build-essential libpcap0.8-dev libx11-dev libfreetype6-dev libavahi-gobject-dev libsm-dev libxrender-dev perl python ruby gcc-multilib g++-multilib

sudo apt-get install libxkbcommon-x11-dev libxkbcommon-dev libxcb-xkb-dev libxcb-cursor-dev libxcb1-dev libxcb-xtest0-dev libx11-xcb-dev
for opengl desktop:
sudo apt install 
libgl1-mesa-dev

for opengl es2:
sudo apt-get install libglfw3-dev libgles2-mesa-dev


2. 配置
./configure -recheck-all -confirm-license -opensource -xplatform linux-arm-gnueabihf-g++ -I /usr/arm-linux-gnueabihf/include -L /usr/lib/arm-linux-gnueabihf/ -L /lib/arm-linux-gnueabihf/ -L /usr/arm-linux-gnueabihf/lib/ -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qtwebengine -skip qtwinextras -opengl es2 -qt-xcb -no-kms -prefix \"${PWD}/../qt-everywhere-install\"                       

參考文獻(xiàn):
https://retifrav.github.io/blog/2018/02/17/build-qt-statically/
https://blog.csdn.net/u012822903/article/details/62058287

只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久综合免费视频影院| 亚洲另类黄色| 日韩网站免费观看| 在线高清一区| 亚洲欧美视频在线观看| 亚洲午夜精品17c| 免费成人黄色片| 久久精品国产一区二区三区免费看 | 亚洲第一中文字幕在线观看| 午夜激情亚洲| 西西裸体人体做爰大胆久久久| 欧美日韩国产综合视频在线观看| 欧美激情按摩在线| 亚洲福利免费| 美女久久一区| 亚洲国产精品va在线观看黑人 | 在线国产日韩| 欧美一区二区啪啪| 久久精品一二三| 国产日韩精品一区二区三区在线| 这里只有精品丝袜| 亚欧成人在线| 国产一区二区精品久久91| 午夜精品一区二区三区在线| 欧美一区=区| 国产欧美一区在线| 久久精品免费电影| 久久综合中文色婷婷| 精品成人国产| 欧美成人一区二区三区| 亚洲国产清纯| 亚洲尤物精选| 国产伦精品一区二区三区| 欧美一级电影久久| 猛男gaygay欧美视频| 亚洲品质自拍| 欧美午夜精品电影| 亚洲欧美日韩精品久久| 久久久噜噜噜久久狠狠50岁| 一区免费观看视频| 欧美v国产在线一区二区三区| 亚洲国产精品一区二区尤物区| 亚洲免费观看| 国产精品午夜视频| 久久另类ts人妖一区二区| 亚洲国产精品一区制服丝袜| 亚洲午夜在线| 国内精品99| 欧美激情国产日韩| 午夜精品久久久久久久99水蜜桃| 久久久视频精品| 亚洲美女免费精品视频在线观看| 欧美图区在线视频| 久久高清福利视频| 亚洲精品资源| 久久亚洲私人国产精品va| 亚洲免费av片| 国产区欧美区日韩区| 另类激情亚洲| 亚洲欧美大片| 亚洲欧洲三级电影| 久久久爽爽爽美女图片| 一区二区欧美日韩视频| 精品电影一区| 国产精品美女www爽爽爽| 久久综合婷婷| 午夜精品影院在线观看| 亚洲激情国产精品| 久久久无码精品亚洲日韩按摩| 日韩午夜免费视频| 国产综合婷婷| 国产精品福利在线| 欧美高清你懂得| 欧美在线视频日韩| 亚洲一区二区三区四区在线观看| 亚洲第一黄网| 老司机精品福利视频| 欧美一区二区三区视频免费| 亚洲激情小视频| 国产在线精品成人一区二区三区 | 欧美日韩一区二区在线播放| 久久大逼视频| 午夜亚洲伦理| 亚洲午夜精品久久| 亚洲精品日韩久久| 亚洲二区免费| 免费一级欧美片在线播放| 欧美一区日韩一区| 香蕉久久一区二区不卡无毒影院 | 久久亚洲私人国产精品va媚药| 亚洲视频精选| 亚洲美女少妇无套啪啪呻吟| 亚洲丁香婷深爱综合| 免费观看亚洲视频大全| 久久久久一区二区三区| 欧美在线免费视屏| 亚洲一区日韩| 亚洲欧美激情四射在线日| 亚洲天堂第二页| 日韩一区二区高清| 日韩视频一区二区| 一本色道久久88综合亚洲精品ⅰ| 91久久精品国产91性色| 亚洲国产日韩在线一区模特| 在线精品福利| 亚洲激情另类| 亚洲精品视频在线观看免费| 亚洲国产精品一区| 亚洲精品日产精品乱码不卡| 亚洲激情一区二区三区| 日韩亚洲精品电影| 亚洲天堂av电影| 亚洲欧美乱综合| 久久爱www| 老牛国产精品一区的观看方式| 免费成人高清| 亚洲国产精品久久久久久女王| 亚洲激情女人| 中日韩高清电影网| 亚洲欧美在线免费观看| 欧美在线免费一级片| 美女亚洲精品| 欧美日韩免费一区| 国产精品实拍| 精品福利免费观看| 日韩香蕉视频| 亚洲一区二区三区午夜| 久久福利影视| 欧美aaa级| 一本色道久久综合亚洲精品小说| 亚洲图片欧美一区| 久久久久久亚洲精品不卡4k岛国| 蜜桃av一区二区| 国产精品成人免费精品自在线观看| 国产精品视频大全| 在线观看欧美激情| 中文久久精品| 狼狼综合久久久久综合网| 亚洲第一精品夜夜躁人人躁 | 亚洲精品日本| 小处雏高清一区二区三区 | 蜜桃av噜噜一区| 欧美性大战久久久久久久| 亚洲日本无吗高清不卡| 亚洲手机成人高清视频| 久久青草欧美一区二区三区| 欧美国产日韩一区| 国产精品网站在线观看| 亚洲精品国产精品国自产观看浪潮| 亚洲一区二区免费看| 美女国内精品自产拍在线播放| aa级大片欧美三级| 久久夜色精品国产亚洲aⅴ| 国产精品国产成人国产三级| 1000部国产精品成人观看| 亚洲香蕉视频| 亚洲国产日韩欧美在线动漫| 欧美在线视频不卡| 欧美亚男人的天堂| 亚洲三级电影全部在线观看高清| 欧美一级视频免费在线观看| 亚洲第一中文字幕| 欧美中文字幕在线视频| 欧美性做爰猛烈叫床潮| 亚洲精品在线免费| 欧美1级日本1级| 欧美影视一区| 国产精品免费视频观看| av成人毛片| 亚洲国产精品第一区二区三区| 欧美一区日韩一区| 国产精品久久久久久久久久直播 | 久久超碰97人人做人人爱| 欧美少妇一区| 日韩视频久久| 亚洲国产日韩欧美在线99| 久久亚洲精品视频| 韩日成人av| 久久精品一区二区国产| 亚洲综合精品自拍| 国产精品成人免费| 亚洲尤物在线视频观看| 日韩亚洲在线| 国产精品成人一区二区三区吃奶| 日韩视频专区| 亚洲美女在线视频| 久久天堂精品| 午夜精品影院在线观看| 国产精品最新自拍| 午夜免费在线观看精品视频| 一区二区三区四区在线| 欧美体内she精视频在线观看| 91久久精品国产91性色| 亚洲缚视频在线观看| 欧美成人一区二区三区| 日韩一级黄色片| 亚洲另类一区二区| 欧美日韩精品不卡| 亚洲欧美一区二区三区极速播放 | 亚洲精品一区二区在线观看|