使用MSVC 2015构建Qt 5.12.1 static之后,我可以成功构建除包含svg模块的项目之外的所有Qt项目。在该项目上运行qmake会产生项目错误:QT中的未知模块:svg
如果我将项目移至Qt的构建路径下(即QTDIR / my-project),则可以正常构建。另外,如果我将文件QTDIR / .qmake.super复制到项目的根目录中,我也可以构建良好。
因此,似乎要使用svg模块进行构建,我需要项目路径层次结构中的.qmake.super文件。也许我错过了一步,或者需要定义其他环境变量。
这是我的配置命令:
configure ^
-static ^
-opensource ^
-confirm-license ^
-nomake tests ^
-nomake examples ^
-debug-and-release ^
-platform win32-msvc2015 ^
-openssl-linked -I %OPENSSL_DIR%\include -L %OPENSSL_DIR%\lib
添加.qmake.super的内容:
QTREPOS += C:/Qt/x64/qtbase
QMAKEMODULES += C:/Qt/x64/qtbase/mkspecs/modules
QTREPOS += C:/Qt/x64/qtnetworkauth
QMAKEMODULES += C:/Qt/x64/qtnetworkauth/mkspecs/modules
QTREPOS += C:/Qt/x64/qtmacextras
QMAKEMODULES += C:/Qt/x64/qtmacextras/mkspecs/modules
QTREPOS += C:/Qt/x64/qtx11extras
QMAKEMODULES += C:/Qt/x64/qtx11extras/mkspecs/modules
QTREPOS += C:/Qt/x64/qtandroidextras
QMAKEMODULES += C:/Qt/x64/qtandroidextras/mkspecs/modules
QTREPOS += C:/Qt/x64/qtserialport
QMAKEMODULES += C:/Qt/x64/qtserialport/mkspecs/modules
QTREPOS += C:/Qt/x64/qtserialbus
QMAKEMODULES += C:/Qt/x64/qtserialbus/mkspecs/modules
QTREPOS += C:/Qt/x64/qtimageformats
QMAKEMODULES += C:/Qt/x64/qtimageformats/mkspecs/modules
QTREPOS += C:/Qt/x64/qtactiveqt
QMAKEMODULES += C:/Qt/x64/qtactiveqt/mkspecs/modules
QTREPOS += C:/Qt/x64/qtsvg
QMAKEMODULES += C:/Qt/x64/qtsvg/mkspecs/modules
QTREPOS += C:/Qt/x64/qtdeclarative
QMAKEMODULES += C:/Qt/x64/qtdeclarative/mkspecs/modules
QTREPOS += C:/Qt/x64/qtremoteobjects
QMAKEMODULES += C:/Qt/x64/qtremoteobjects/mkspecs/modules
QTREPOS += C:/Qt/x64/qtscxml
QMAKEMODULES += C:/Qt/x64/qtscxml/mkspecs/modules
QTREPOS += C:/Qt/x64/qtpurchasing
QMAKEMODULES += C:/Qt/x64/qtpurchasing/mkspecs/modules
QTREPOS += C:/Qt/x64/qtcanvas3d
QMAKEMODULES += C:/Qt/x64/qtcanvas3d/mkspecs/modules
QTREPOS += C:/Qt/x64/qtwebsockets
QMAKEMODULES += C:/Qt/x64/qtwebsockets/mkspecs/modules
QTREPOS += C:/Qt/x64/qtwebglplugin
QMAKEMODULES += C:/Qt/x64/qtwebglplugin/mkspecs/modules
QTREPOS += C:/Qt/x64/qtwebchannel
QMAKEMODULES += C:/Qt/x64/qtwebchannel/mkspecs/modules
QTREPOS += C:/Qt/x64/qtgamepad
QMAKEMODULES += C:/Qt/x64/qtgamepad/mkspecs/modules
QTREPOS += C:/Qt/x64/qt3d
QMAKEMODULES += C:/Qt/x64/qt3d/mkspecs/modules
QTREPOS += C:/Qt/x64/qtwayland
QMAKEMODULES += C:/Qt/x64/qtwayland/mkspecs/modules
QTREPOS += C:/Qt/x64/qtconnectivity
QMAKEMODULES += C:/Qt/x64/qtconnectivity/mkspecs/modules
QTREPOS += C:/Qt/x64/qtsensors
QMAKEMODULES += C:/Qt/x64/qtsensors/mkspecs/modules
QTREPOS += C:/Qt/x64/qtgraphicaleffects
QMAKEMODULES += C:/Qt/x64/qtgraphicaleffects/mkspecs/modules
QTREPOS += C:/Qt/x64/qtquickcontrols2
QMAKEMODULES += C:/Qt/x64/qtquickcontrols2/mkspecs/modules
QTREPOS += C:/Qt/x64/qtquickcontrols
QMAKEMODULES += C:/Qt/x64/qtquickcontrols/mkspecs/modules
QTREPOS += C:/Qt/x64/qtlocation
QMAKEMODULES += C:/Qt/x64/qtlocation/mkspecs/modules
QTREPOS += C:/Qt/x64/qtxmlpatterns
QMAKEMODULES += C:/Qt/x64/qtxmlpatterns/mkspecs/modules
QTREPOS += C:/Qt/x64/qtmultimedia
QMAKEMODULES += C:/Qt/x64/qtmultimedia/mkspecs/modules
QTREPOS += C:/Qt/x64/qtspeech
QMAKEMODULES += C:/Qt/x64/qtspeech/mkspecs/modules
QTREPOS += C:/Qt/x64/qtvirtualkeyboard
QMAKEMODULES += C:/Qt/x64/qtvirtualkeyboard/mkspecs/modules
QTREPOS += C:/Qt/x64/qtdatavis3d
QMAKEMODULES += C:/Qt/x64/qtdatavis3d/mkspecs/modules
QTREPOS += C:/Qt/x64/qtcharts
QMAKEMODULES += C:/Qt/x64/qtcharts/mkspecs/modules
QTREPOS += C:/Qt/x64/qtwinextras
QMAKEMODULES += C:/Qt/x64/qtwinextras/mkspecs/modules
QTREPOS += C:/Qt/x64/qttools
QMAKEMODULES += C:/Qt/x64/qttools/mkspecs/modules
QTREPOS += C:/Qt/x64/qtscript
QMAKEMODULES += C:/Qt/x64/qtscript/mkspecs/modules
QTREPOS += C:/Qt/x64/qtwebengine
QMAKEMODULES += C:/Qt/x64/qtwebengine/mkspecs/modules
QTREPOS += C:/Qt/x64/qtwebview
QMAKEMODULES += C:/Qt/x64/qtwebview/mkspecs/modules
QTREPOS += C:/Qt/x64/qttranslations
QMAKEMODULES += C:/Qt/x64/qttranslations/mkspecs/modules
QTREPOS += C:/Qt/x64/qtdoc
QMAKEMODULES += C:/Qt/x64/qtdoc/mkspecs/modules
QTREPOS += C:/Qt/x64/qtqa
QMAKEMODULES += C:/Qt/x64/qtqa/mkspecs/modules
答案 0 :(得分:0)
简单修复:在配置中指定前缀,然后进行nmake安装。安装的内部版本在任何地方都不需要.qmake.super。