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

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 宋鵬 閱讀(1666) 評論(0)  編輯 收藏 引用 所屬分類: Qt

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

參考代碼里的Readme:

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

2.環境變量
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的路徑,就會被推薦用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(動態鏈接改為靜態鏈接):
修改文件:
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
否則會報錯:
msvc-version.conf loaded but qmake_msc_ver isn't set

運行C:\Qt\Qt5.10.1_src>configure.bat 確認配置
5.編譯:
<license>選擇-opensource
控制臺選擇:
開始 -> 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

瘋狂的縮減編譯選擇,可以用來嘗試最小化編譯,當然我失敗了( 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(想編譯哪個 就去掉哪個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.
結果:
Static builds of QtWebEngine aren't supported.
"Some of the required modules (android|ios|winrt|qtHaveModule(webengine)) are not available."
skip webengine 繼續測試:
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 
結果:
成功

成功的組合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只是在單獨編譯qtbase時有用,于是以后采用的成功的組合2,總結命令為:
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.

環境:Ubuntu 18.10/linux g++


1.安裝:

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

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


2.環境變量:
linux的環境變量 只要不是特殊安裝的,應該都被包含在內了

3.代碼:
同上

4.動態鏈接改為靜態鏈接:
linux沒有md/mt,編譯都時候 直接-static應該就可以。

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 
編譯出錯
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有關的bug。。由于原來的patch已經對不上號,所以切換到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執行出錯:
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 
編譯出錯
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
結果:
成功。

5.10.1的關于glibc的renameat的bug,被官方在5.11的branch里修復如下:
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>

環境:Ubuntu 18.04/交叉編譯 arm


1.安裝:

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

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\"                       

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

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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>
            久久国产精品网站| 久久躁日日躁aaaaxxxx| 亚洲精品在线免费| 欧美精品在线视频观看| 夜夜嗨av一区二区三区四区| 亚洲日本中文字幕区| 欧美成人免费网站| 亚洲一区二区精品| 先锋影院在线亚洲| 一区在线免费| 亚洲黄色免费电影| 欧美午夜女人视频在线| 欧美一区国产在线| 久久久久久综合| 亚洲免费不卡| 亚洲一级黄色av| 国内精品久久久久久久果冻传媒 | 亚洲激情视频在线观看| 亚洲国产精品一区二区三区| 欧美日韩免费一区二区三区| 欧美主播一区二区三区| 玖玖综合伊人| 亚洲综合日韩在线| 久久久久九九九九| 日韩视频在线永久播放| 亚洲欧美另类在线观看| 在线日韩电影| 亚洲图片激情小说| 亚洲国产日本| 亚洲永久精品大片| 亚洲精品你懂的| 午夜视频在线观看一区二区三区 | 欧美视频在线一区二区三区| 欧美一区1区三区3区公司| 久久久久久亚洲精品杨幂换脸| 亚洲精品偷拍| 欧美一区中文字幕| 一区二区三区高清视频在线观看 | 狂野欧美一区| 欧美日韩视频一区二区| 久久尤物视频| 国产精品推荐精品| 亚洲国产91色在线| 伊人夜夜躁av伊人久久| 一区二区三区视频在线播放| 亚洲成色最大综合在线| 亚洲欧美怡红院| 日韩网站免费观看| 蜜臀va亚洲va欧美va天堂| 翔田千里一区二区| 欧美色一级片| 亚洲第一精品在线| 精品动漫一区二区| 午夜视频一区二区| 欧美一级播放| 国产精品素人视频| 亚洲午夜日本在线观看| 亚洲性色视频| 欧美日韩国产精品专区| 亚洲国产精品免费| 91久久国产综合久久蜜月精品 | 亚洲黄色影院| 91久久线看在观草草青青| 欧美中文在线免费| 久久精品日韩| 国产三级精品在线不卡| 中文一区二区| 亚洲欧美色一区| 欧美日韩中文在线| 国产精品99久久不卡二区 | 国产精品午夜春色av| 9国产精品视频| 中文有码久久| 欧美性猛交xxxx免费看久久久| 最新日韩在线| 亚洲视频一二| 国产精品v亚洲精品v日韩精品| 亚洲美洲欧洲综合国产一区| 一本一本a久久| 国产精品久久久久久av下载红粉| 一道本一区二区| 亚洲欧美一区二区原创| 国产精品一区二区黑丝| 亚洲欧美另类综合偷拍| 久久久久久69| 亚洲高清视频一区| 欧美激情视频网站| 一区二区三区欧美日韩| 性xx色xx综合久久久xx| 狠狠色丁香婷婷综合| 另类图片综合电影| 亚洲欧洲一区二区三区| 亚洲欧美国产另类| 国内一区二区三区| 欧美黄在线观看| 亚洲网站啪啪| 麻豆成人在线观看| 亚洲天堂av在线免费观看| 国产精品私人影院| 免费视频亚洲| 亚洲一区二区黄色| 欧美成人官网二区| 中文亚洲视频在线| 一区久久精品| 国产精品高潮呻吟久久| 久久久蜜臀国产一区二区| 亚洲精品视频在线观看免费| 欧美亚洲免费在线| 亚洲国产二区| 国产精品一区在线观看你懂的| 久久午夜羞羞影院免费观看| 亚洲精品永久免费精品| 久久视频免费观看| 亚洲网友自拍| 亚洲国产综合在线看不卡| 国产精品人人爽人人做我的可爱| 久久先锋影音av| 午夜精品久久久久久久久久久久| 欧美成人一品| 久久精品在线播放| 亚洲欧美国产精品桃花| 亚洲破处大片| 在线精品视频在线观看高清| 国产精品看片资源| 欧美国产日产韩国视频| 久久久久99精品国产片| 亚洲免费视频网站| 日韩视频中午一区| 亚洲风情在线资源站| 久久综合给合| 久久久精品动漫| 欧美在线啊v一区| 在线视频中文亚洲| 亚洲人妖在线| 亚洲国产经典视频| 黑人巨大精品欧美黑白配亚洲 | 久久精品国产99国产精品| 亚洲图片在区色| 亚洲人成网站在线观看播放| 欧美成人小视频| 蜜桃av噜噜一区| 久久亚洲综合网| 久久久最新网址| 久久久噜噜噜| 久久伊人免费视频| 麻豆成人在线| 欧美18av| 亚洲国产成人av好男人在线观看| 欧美凹凸一区二区三区视频| 免费看黄裸体一级大秀欧美| 麻豆精品一区二区av白丝在线| 久久精品一区蜜桃臀影院| 久久男人av资源网站| 久久婷婷亚洲| 麻豆成人综合网| 亚洲国产精品99久久久久久久久| 你懂的国产精品| 亚洲国产合集| 99精品欧美| 亚洲女性裸体视频| 久久大综合网| 久久综合九色九九| 欧美激情亚洲| 欧美午夜不卡| 国产亚洲激情视频在线| 狠狠色丁香久久婷婷综合丁香| 在线观看日韩av电影| 亚洲精品久久视频| 亚洲视频一二区| 久久精品中文字幕免费mv| 欧美成人亚洲成人日韩成人| 日韩视频精品| 欧美在线亚洲| 欧美电影电视剧在线观看| 欧美午夜宅男影院| 国产日韩欧美三级| 亚洲第一黄色| 亚洲欧美制服中文字幕| 久久久人成影片一区二区三区| 欧美国产日韩xxxxx| 99视频精品免费观看| 欧美在线日韩在线| 欧美极品影院| 国产一区二区久久久| 亚洲精品中文字幕有码专区| 午夜精品久久久久久久蜜桃app| 久久三级视频| 亚洲视频观看| 欧美大尺度在线| 国产真实乱偷精品视频免| 日韩亚洲欧美在线观看| 久热精品在线视频| 宅男精品导航| 欧美成人精品1314www| 国产婷婷成人久久av免费高清| 亚洲精品免费在线观看| 久久婷婷久久| 亚洲欧美日韩在线播放| 欧美美女视频| 亚洲国产精品第一区二区三区|