QT6从源构建错误。 Xcode,Ninja Multi-Config和Visual Studio Generators仅支持Multi-Config构建

发布于 2025-01-28 03:43:59 字数 3265 浏览 2 评论 0 原文

我正在尝试从来源构建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

我都做到了,还是什么是不正确的?我该怎么办来解决此错误?

I'm trying to build Qt6.3.0 from sources.
I'm new in qt and trying to build static version.
I'm use this tree:
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:
I add this in end of file:

# 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

In 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

But this give me this error:

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.

If i think right, it not support MinGW generator? What kind of generator should i use?

This my path:

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

From qt installer(what i installed):

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

I also have this:
Python v3.10.4
Strawberry Perl v5.32.1

My os:
Windows 10 Build 19044

I all make true or what is incorrect? What i should do to fix this error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白首有我共你 2025-02-04 03:43:59

我能够在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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文