QT6从源构建错误。 Xcode,Ninja Multi-Config和Visual Studio Generators仅支持Multi-Config构建
我正在尝试从来源构建QT6.3.0。 我是QT的新手,并尝试构建静态版本。 我用这棵树: c:/qt/6.3.0/src c:/qt/6.3.0/static
in C:/qt/6.3.0/src/qtbase/mkspecs/win32-g ++/qmake.conf: 我将其添加到文件末尾:
# Static
QMAKE_LFLAGS += -static -static-libgcc
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer
DEFINES += QT_STATIC_BUILD
CONFIG += static
# Static
在c:/qt/6.3.0/static/make.bat中:
set QtDir=C:/Qt/6.3.0/static
set MingwDir=C:/Qt/Tools/mingw1120_64
set QtSrcDir=C:/Qt/6.3.0/Src
set CMAKE_INCLUDE_PATH=%MingwDir%/x86_64-w64-mingw32/include
:: Set a clean path including MinGW.
set PATH=%PATH%;%MingwDir%/bin;%MingwDir%/opt/bin
:: Force English locale to avoid weird effects of tools localization.
set LANG=en
:: Set environment variable QT_INSTALL_PREFIX. Documentation says it should be
:: used by configure as prefix but this does not seem to work. So, we will
:: also specify -prefix option in configure.
set QT_INSTALL_PREFIX=%QtDir%
:: Configure, compile and install Qt.
cmd /c "%QtSrcDir%/configure.bat -static -debug-and-release -platform win32-g++ -prefix %QtDir% -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sqlite -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests" > log_cmd.txt
mingw32-make -k -j6 > log_make.txt
mingw32-make -k -j6 install > log_make_install.txt
pause
但是这给我这个错误:
CMake Warning at C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:264 (message):
'-nomake tools' is not implemented yet.
Call Stack (most recent call first):
C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:790 (qtConfAddWarning)
C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:849 (check_qt_build_parts)
CMake Warning at C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:264 (message):
'-make libs' is not implemented yet.
Call Stack (most recent call first):
C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:790 (qtConfAddWarning)
C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:850 (check_qt_build_parts)
CMake Error at C:/Qt/6.3.0/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:940 (message):
Multi-config build is only supported by Xcode, Ninja Multi-Config and
Visual Studio generators. Current generator is "MinGW Makefiles".
Note: Use '-cmake-generator <generator name>' option to specify the
generator manually.
如果我认为正确,它不支持mingw Generator?我应该使用什么样的发电机?
这是我的路径:
D:\YD\Python\py\
D:\YD\Python\py\Scripts\
C:\Qt\Tools\CMake_64\bin
C:\Qt\Tools\mingw1120_64\bin
C:\Strawberry\perl\bin
来自QT安装程序(我安装的内容):
Qt/Qt6.3.0/MinGW 11.2.0 64-bit
Qt/Qt6.3.0/Sources
Qt/Qt6.3.0/Qt Shader Tools
Qt/Qt6.3.0/Additional Libraries
Qt/Qt6.3.0/Qt Debug Information Files
Developer and Designel Tools/Qt Creator 7.0.1 . . .
Developer and Designel Tools/Debuging Tools for Windows
Developer and Designel Tools/Qt Creator 7.0.1 Debug Symbols
Developer and Designel Tools/Qt Creator 7.0.1 Plugin Development
Developer and Designel Tools/MinGW 11.2.0 64-bit
我也有: Python v3.10.4 草莓perl v5.32.1
我的操作系统: Windows 10构建19044
我都做到了,还是什么是不正确的?我该怎么办来解决此错误?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够在msys2 shell(cmake flag
-gninja
)下使用cmake with ninja构建QT 6.3.0的静态版本和共享版本文件夹,但同一安装目标(相同-dcmake_install_prefix =
cmake flag)。如果您想了解有关我的构建方式的详细信息,请参见(对不起,这有点混乱,因为我在那里留下了很多以前的尝试)。
I am able to build both static and shared versions of Qt 6.3.0 using CMake with Ninja under MSYS2 shell (Cmake flag
-GNinja
), but I build them separately using a different out-of-source build folder but the same install destination (same-DCMAKE_INSTALL_PREFIX=
CMake flag).If you want to find out the details on how my build works, see https://github.com/brechtsanders/winlibs_recipes/blob/main/recipes/qt6.winlib (sorry, it's a bit messy because I leave a lot of previous attempts in there as comments).