firemail
标题: qt5.6.2源码编译 [打印本页]
作者: Qter 时间: 2020-2-23 07:20
标题: qt5.6.2源码编译
本帖最后由 Qter 于 2020-3-13 14:24 编辑
- git clone git://code.qt.io/qt/qt5.git qt5_6_2
- cd qt5_6_2
- perl init-repository --module-subset=qtbase,qtimageformats
- git checkout v5.6.2
- cd qtimageformats
- git checkout v5.6.2
- cd ..\qtbase
- git checkout v5.6.2
- git apply ../../../longchat-tdesktop/Telegram/Patches/qtbase_5_6_2.diff
- cd ..
- configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\Release\include" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\Debug\lib\ssleay32.lib %cd%\..\openssl\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\Release\lib\ssleay32.lib %cd%\..\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015
- jom -j4
- jom -j4 install
复制代码 https://code.qt.io/cgit/
搜索 qt/qt5.git
进入 https://code.qt.io/cgit/qt/qt5.git/
执行 jom -j4 时报如下错误:
- F:\TBuild\Libraries\qt5_6_2>jom -j4
- jom 1.1.3 - empower your cores
- cd qtbase\ && ( if not exist Makefile F:\TBuild\Libraries\qt5_6_2\qtbase\bin\qmake F:\TBuild\Libraries\qt5_6_2\qtbase\qtbase.pro -o Makefile ) && F:\TBuild\ThirdParty\jom\jom.exe -f Makefile
- F:/TBuild/Libraries/qt5_6_2/qtbase/mkspecs/qconfig.pri:20: Extra characters after test expression.
- ...............
- rcc.cpp
- cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Zi -MTd -D_HAS_EXCEPTIONS=0 -MP -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\debug\rcc.vc.pdb -DUNICODE -DWIN32 -DQT_RCC -DQT_NO_CAST_FROM_ASCII -DQT_USE_QSTRINGBUILDER -DQT_NO_EXCEPTIONS -DQT_BOOTSTRAP_LIB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DQT_NO_DYNAMIC_CAST -I. -I. -I..\..\..\include -I..\..\..\include\QtCore -I..\..\..\include\QtCore\5.6.2 -I..\..\..\include\QtCore\5.6.2\QtCore -I..\..\..\include\QtXml -I..\..\..\include\QtXml\5.6.2 -I..\..\..\include\QtXml\5.6.2\QtXml -IF:\TBuild\Libraries\openssl\Release\include -I..\..\..\mkspecs\win32-msvc2015 -Fo.obj\debug\ @C:\Users\ADMINI~1\AppData\Local\Temp\main.obj.18992.15.jom
- main.cpp
- link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:..\..\..\bin\rcc.exe @C:\Users\ADMINI~1\AppData\Local\Temp\rcc.exe.18992.1125.jom
- QtBootstrapd.lib(qbytearray.obj) : error LNK2019: 无法解析的外部符号 _z_compress2,该符号在函数 "class QByteArray __cdecl qCompress(unsigned char const *,int,int)" (?qCompress@@YA?AVQByteArray@@PBEHH@Z) 中被引用
- QtBootstrapd.lib(qbytearray.obj) : error LNK2019: 无法解析的外部符号 _z_uncompress,该符号在函数 "class QByteArray __cdecl qUncompress(unsigned char const *,int)" (?qUncompress@@YA?AVQByteArray@@PBEH@Z) 中被引用
- ..\..\..\bin\rcc.exe : fatal error LNK1120: 2 个无法解析的外部命令
- :/TBuild/Libraries/qt5_6_2/qtbase/mkspecs/qconfig.pri:20: Extra characters after test expression.
- ....
- F:/TBuild/Libraries/qt5_6_2/qtbase/mkspecs/qconfig.pri:68: Extra characters after test expression.
- jom: F:\TBuild\Libraries\qt5_6_2\qtbase\src\tools\rcc\Makefile.Debug [..\..\..\bin\rcc.exe] Error 1120
- jom: F:\TBuild\Libraries\qt5_6_2\qtbase\src\tools\rcc\Makefile [debug] Error 2
- link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:..\..\..\bin\moc.exe @C:\Users\ADMINI~1\AppData\Local\Temp\moc.exe.8916.1875.jom
- QtBootstrapd.lib(qbytearray.obj) : error LNK2019: 无法解析的外部符号 _z_compress2,该符号在函数 "class QByteArray __cdecl qCompress(unsigned char const *,int,int)" (?qCompress@@YA?AVQByteArray@@PBEHH@Z) 中被引用
- QtBootstrapd.lib(qbytearray.obj) : error LNK2019: 无法解析的外部符号 _z_uncompress,该符号在函数 "class QByteArray __cdecl qUncompress(unsigned char const *,int)" (?qUncompress@@YA?AVQByteArray@@PBEH@Z) 中被引用
- ..\..\..\bin\moc.exe : fatal error LNK1120: 2 个无法解析的外部命令
- jom: F:\TBuild\Libraries\qt5_6_2\qtbase\src\tools\moc\Makefile.Debug [..\..\..\bin\moc.exe] Error 1120
- jom: F:\TBuild\Libraries\qt5_6_2\qtbase\src\tools\moc\Makefile [debug] Error 2
- jom: F:\TBuild\Libraries\qt5_6_2\qtbase\src\Makefile [sub-moc-make_first] Error 2
- jom: F:\TBuild\Libraries\qt5_6_2\qtbase\src\Makefile [sub-rcc-make_first] Error 2
- jom: F:\TBuild\Libraries\qt5_6_2\qtbase\Makefile [sub-src-make_first] Error 2
- jom: F:\TBuild\Libraries\qt5_6_2\Makefile [module-qtbase-make_first] Error 2
- F:\TBuild\Libraries\qt5_6_2>
复制代码 QTBUG-33357
Ok I was digging a little more and have found that even if you defined the -D Z_PREFIX at the configure time the bootstrap Makefile doesn't contain it.
Now if we look at the corelib makefile we see -DUNICODE -DWIN32 -DWIN64 -DZ_PREFIX -DQT_NO_USING_NAMESPACE... the Z_PREFIX is defined clearly, but if we look at the bootstrap makefile -DUNICODE -DWIN32 -DWIN64 -DQT_BOOTSTRAPPED the Z_PREFIX is missing.
Now I don't know what bootstrap does in the first place, but adding -DZ_PREFIX to it's makefiles fixes my issue. ---没成功
QT compile error. #3702
jom clean [all]
Configure
Edited the file Libraries\qt5_6_2\qtbase\mkspecs\qconfig.pri and removed the last line with MS copyright.
jom -j4
I don't know what to suggest. Right now I've launched the "x86 Native Tools Command Prompt for VS 2017" and launched in a separate folder those commands from the current instructions:
- git clone https://github.com/openssl/openssl.git
- cd openssl
- git checkout OpenSSL_1_0_1-stable
- perl Configure no-shared --prefix=%cd%\Release --openssldir=%cd%\Release VC-WIN32
- ms\do_ms
- nmake -f ms\nt.mak
- nmake -f ms\nt.mak install
- nmake -f ms\nt.mak clean
- perl Configure no-shared --prefix=%cd%\Debug --openssldir=%cd%\Debug debug-VC-WIN32
- ms\do_ms
- nmake -f ms\nt.mak
- nmake -f ms\nt.mak install
- cd ..
- git clone git://code.qt.io/qt/qt5.git qt5_6_2
- cd qt5_6_2
- perl init-repository --module-subset=qtbase,qtimageformats
- git checkout v5.6.2
- cd qtimageformats
- git checkout v5.6.2
- cd ..\qtbase
- git checkout v5.6.2
- git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff
- cd ..
- configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\Release\include" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\Debug\lib\ssleay32.lib %cd%\..\openssl\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\Release\lib\ssleay32.lib %cd%\..\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015
- jom -j4
- jom -j4 install
- cd ..
复制代码And all of them worked without errors, everything was built (openssl and Qt).
I faced this build error issue and I've found the workaround solution.
It's dirty but maybe working well in your environment too.
- clean all (I think you'd better restart from github clone step.)
- open \TBuild\Libraries\qt5_6_2\qtbase\tools\configure\environment.cpp
- find QString Environment::msvcVersion() method.
- replace like below
//QString version = execute(command, &returnValue);
QString version = "Microsoft (R) C/C++ Optimizing Compiler Version 19.12.25835 for x86";
! please check your compiler version to execute cl.exe in cmd.exe by yourself and then fix the version number text above. MUST BE ENGLISH TEXT!
作者: Qter 时间: 2020-2-23 14:48
D:\TBuild\Libraries\qt5_6_2\qtbase\src\tools\bootstrap下的
Makefile Makefile.Debug Makefile.Release不同
而且这三个文件是没有对应的日志的,判断它是如何来的?- configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\Release\include" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\Debug\lib\ssleay32.lib %cd%\..\openssl\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\Release\lib\ssleay32.lib %cd%\..\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015
复制代码 上面这句生成的?
作者: Qter 时间: 2020-2-24 09:28
改成从github上获取源码- git clone https://github.com/qt/qt5.git qt5_6_2
- cd qt5_6_2
- perl init-repository --module-subset=qtbase,qtimageformats
- git checkout v5.6.2
- cd qtimageformats
- git checkout v5.6.2
- cd ..\qtbase
- git checkout v5.6.2
- git apply ../../../longchat-tdesktop/Telegram/Patches/qtbase_5_6_2.diff
- cd ..
复制代码
作者: Qter 时间: 2020-2-28 17:26
本帖最后由 Qter 于 2020-3-13 14:21 编辑
拉取新版本上的tdesktop/Telegram/Patches/qtbase_5_6_2.diff 这个补丁文件 v1.8.0_ok
作者: Qter 时间: 2020-2-28 17:51
https://wiki.qt.io/Get_the_Source
欢迎光临 firemail (http://firemail.wang:8088/) |
Powered by Discuz! X3 |