WINDOWS安装正常流程:
- 从http://releases.qt-project.org/qt5.0/alpha/获取源码包。
- 从perl.org上下载perl,自动添加perl路径的环境变量。(此步是因为configure.bat脚本解析需要)
- 下载mingw-get-inst-20111118.exe,安装最新的mingw 4.6.1(C、C++、msys),把mingw的路径增加到系统PATH环境变量中。(此步一是因为configure.bat脚本解析需要编译器,另外是为了支持gcc的命令行参数-fno-keep-inline-dllexport,QTSDK 1.2自带的mingw 4.4不支持此参数)
- 将python.exe的路径增加到系统环境变量中。(此步是因为qtjsbackend需要)
- 重启WINDOWS。
- mingw-get install mintty
- cd qtbase
- configure -debug -opensource -confirm-license -nomake examples -nomake tests -fast
将-developer-build改成-debug,因为这样-developer-build生成的库对qt creator不友好。 - mingw32-make,qtbase编译成功。
- cd qtjsbackend
- qmake
- mingw32-make,qtjsbackend编译成功。
- cd qtxmlpatterns
- qmake
- mingw32-make,qtxmlpatterns编译成功。
- cd qtdeclarative(依赖qtjsbackend和xmlpatterns),把qtdeclarative\modules\qt_declarative.pri中QT.qtdeclarative.DEFINES全删了。那些宏是因为QML把类名又从QDeclarative改成QQML了,然后定义了一串宏为了兼容之前使用QML的旧代码,不是QT5哦。QT5 alpha又没有旧代码。
- qmake
- mingw32-make,编译成功。
- cd qt3d(依赖qtdeclarative)
- qmake
- mingw32-make,编译成功。
在qmake时,会把模块下面modules\xxx.pri拷贝到qtbase\mkspecs\modules下。
=======================================================================================================
遇到的问题:
编译qtbase时出现:
问题1:
g++ -c -fno-keep-inline-dllexport -g -frtti -fexceptions -mthreads -Wall -DUNICO
DE -DQT_LARGEFILE_SUPPORT -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_
ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIA
NT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_THRE
AD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NODLL -
I"..\..\..\include" -I"..\..\..\include\QtCore" -I"..\..\..\include\QtCore\5.0.0
" -I"..\..\..\include\QtCore\5.0.0\QtCore" -I"..\..\3rdparty\zlib" -I"..\..\..\m
kspecs\win32-g++" -o tmp\obj\debug_shared\qlatincodec.o ..\..\corelib\codecs\qla
tincodec.cpp
cc1plus.exe: error: unrecognized command line option "-fno-keep-inline-dllexport
"
mingw32-make[2]: *** [tmp/obj/debug_shared/qlatincodec.o] Error 1
mingw32-make[2]: Leaving directory `G:/qt-everywhere-opensource-src-5.0.0/qtbase
/src/tools/bootstrap'
mingw32-make[1]: *** [debug] Error 2
mingw32-make[1]: Leaving directory `G:/qt-everywhere-opensource-src-5.0.0/qtbase
/src/tools/bootstrap'
|
编译qtjsbackend时出现:
问题1:
process_begin: CreateProcess(NULL, python G:/qt-everywhere-opensource-src-5.0.0/ qtjsbackend/src/v8/../3rdparty/v8/tools/js2c.py generated-debug/libraries.cpp CO RE off G:/qt-everywhere-opensource-src-5.0.0/qtjsbackend/src/v8/../3rdparty/v8/s rc/macros.py ..\3rdparty\v8\src\runtime.js ..\3rdparty\v8\src\v8natives.js ..\3r dparty\v8\src\array.js ..\3rdparty\v8\src\string.js ..\3rdparty\v8\src\uri.js .. \3rdparty\v8\src\math.js ..\3rdparty\v8\src\messages.js ..\3rdparty\v8\src\apina tives.js ..\3rdparty\v8\src\date.js ..\3rdparty\v8\src\regexp.js ..\3rdparty\v8\ src\json.js ..\3rdparty\v8\src\liveedit-debugger.js ..\3rdparty\v8\src\mirror-de bugger.js ..\3rdparty\v8\src\debug-debugger.js, ...) failed. make (e=2): mingw32-make[3]: *** [generated-debug/libraries.cpp] Error 2 mingw32-make[3]: Leaving directory `G:/qt-everywhere-opensource-src-5.0.0/qtjsba ckend/src/v8' mingw32-make[2]: *** [debug-install] Error 2 mingw32-make[2]: Leaving directory `G:/qt-everywhere-opensource-src-5.0.0/qtjsba ckend/src/v8' mingw32-make[1]: *** [sub-v8-install_subtargets-ordered] Error 2 mingw32-make[1]: Leaving directory `G:/qt-everywhere-opensource-src-5.0.0/qtjsba ckend/src' mingw32-make: *** [module-qtjsbackend-src-install_subtargets] Error 2 |
编译qtdeclarative时出现:
问题1:
windres -i qmldbg_qtquick2d_resource.rc -o debug\qmldbg_qtquick2d_resource_res.o --include-dir=. -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_PLUGIN -DQT_QUIC K_LIB -DQDeclarativeAbstractAnimation=QQuickAbstractAnimation -DQDeclarativeAbst ractBinding=QQmlAbstractBinding -DQDeclarativeAbstractBoundSignal=QQmlAbstractBo undSignal -DQDeclarativeAccessible=QQmlAccessible -DQDeclarativeAccessibleAttach ed=QQmlAccessibleAttached -DQDeclarativeAccessorProperties=QQmlAccessorPropertie s -DQDeclarativeAction=QQuickAction -DQDeclarativeActionEvent=QQuickActionEvent -DQDeclarativeAnimationGroup=QQuickAnimationGroup -DQDeclarativeAnimationPropert yUpdater=QQuickAnimationPropertyUpdater -DQDeclarativeApplication=QQuickApplicat ion -DQDeclarativeBehavior=QQuickBehavior -DQDeclarativeBind=QQuickBind -DQDecla rativeBinding=QQmlBinding -DQDeclarativeBindingProfiler=QQmlBindingProfiler -DQD eclarativeBoundSignal=QQmlBoundSignal -DQDeclarativeBuiltinFunctions=QQmlBuiltin Functions -DQDeclarativeBulkValueAnimator=QQuickBulkValueAnimator -DQDeclarative ChangeSet=QQuickChangeSet -DQDeclarativeCleanup=QQmlCleanup -DQDeclarativeC |