gpt4 book ai didi

windows - 为什么我在尝试构建 QT 的静态版本时遇到 NMAKE 错误?

转载 作者:行者123 更新时间:2023-12-03 11:07:10 28 4
gpt4 key购买 nike

我正在尝试在 x64 Native Tools VS 2017 命令提示符中使用这些命令创建 Qt 5.13.0 的静态版本。但是,我收到 nmake 错误,我不确定如何修复。第一个命令也给了我一个问题。

configure -static -release -nomake examples -platform win32-msvc
nmake

第一个命令给了我这个:

Note: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.

Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.

WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.

Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation.
On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
On macOS, you can use Homebrew's llvm package.
On Windows, you must set LLVM_INSTALL_DIR to the installation path.

WARNING: Python version 2 (2.7.5 or later) is required to build QtWebEngine.

Qt is now configured for building. Just run 'nmake'.
Once everything is built, you must run 'nmake install'.
Qt will be installed into 'C:\Qt\Qt-5.13.0'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

我忽略它并使用 nmake 命令。但是,我在过程中途遇到了一组错误。请原谅行数,但我不确定到底是哪个错误导致了 fatal error ,或者为什么会抛出它:

qwin10helpers.cpp
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Contacts.h(7090): error C2146: syntax error: missing '}' before identifier 'DEPRECATEDENUMERATOR'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Contacts.h(7090): error C2143: syntax error: missing ';' before '<L_TYPE_raw>'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Contacts.h(7148): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Contacts.h(7152): error C2059: syntax error: '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Contacts.h(7152): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Contacts.h(7166): error C2143: syntax error: missing ';' before '{'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Contacts.h(7166): error C2447: '{': missing function header (old-style formal list?)
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Security.EnterpriseData.h(2075): error C2146: syntax error: missing '}' before identifier 'DEPRECATEDENUMERATOR'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Security.EnterpriseData.h(2075): error C2143: syntax error: missing ';' before '<L_TYPE_raw>'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Security.EnterpriseData.h(2127): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Security.EnterpriseData.h(2131): error C2059: syntax error: '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Security.EnterpriseData.h(2131): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Security.EnterpriseData.h(2145): error C2143: syntax error: missing ';' before '{'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Security.EnterpriseData.h(2145): error C2447: '{': missing function header (old-style formal list?)
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Networking.Sockets.h(3127): error C2146: syntax error: missing '}' before identifier 'DEPRECATEDENUMERATOR'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Networking.Sockets.h(3127): error C2143: syntax error: missing ';' before '<L_TYPE_raw>'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Networking.Sockets.h(3170): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Networking.Sockets.h(3174): error C2059: syntax error: '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Networking.Sockets.h(3174): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Networking.Sockets.h(3188): error C2143: syntax error: missing ';' before '{'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Networking.Sockets.h(3188): error C2447: '{': missing function header (old-style formal list?)
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.UI.Notifications.h(3833): error C2146: syntax error: missing '}' before identifier 'DEPRECATEDENUMERATOR'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.UI.Notifications.h(3833): error C2143: syntax error: missing ';' before '<L_TYPE_raw>'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.UI.Notifications.h(4461): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.UI.Notifications.h(4465): error C2059: syntax error: '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.UI.Notifications.h(4465): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.UI.Notifications.h(4479): error C2143: syntax error: missing ';' before '{'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.UI.Notifications.h(4479): error C2447: '{': missing function header (old-style formal list?)
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Render.h(163): error C2146: syntax error: missing '}' before identifier 'DEPRECATEDENUMERATOR'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Render.h(163): error C2143: syntax error: missing ';' before '<L_TYPE_raw>'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Render.h(196): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Render.h(200): error C2059: syntax error: '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Render.h(200): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Effects.h(269): error C2143: syntax error: missing ';' before '{'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Effects.h(269): error C2447: '{': missing function header (old-style formal list?)
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Effects.h(902): error C2039: 'IAudioCaptureEffectsManager': is not a member of 'ABI::Windows::Media::Effects'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Effects.h(886): note: see declaration of 'ABI::Windows::Media::Effects'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Effects.h(902): error C2065: 'IAudioCaptureEffectsManager': undeclared identifier
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Effects.h(902): error C2059: syntax error: '>'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.Media.Effects.h(903): error C3770: 'unknown-type': is not a valid base class
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Background.h(4289): error C2146: syntax error: missing '}' before identifier 'DEPRECATEDENUMERATOR'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Background.h(4289): error C2143: syntax error: missing ';' before '<L_TYPE_raw>'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Background.h(4322): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Background.h(4326): error C2059: syntax error: '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Background.h(4326): error C2143: syntax error: missing ';' before '}'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Background.h(4340): error C2143: syntax error: missing ';' before '{'
c:\program files (x86)\windows kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Background.h(4340): error C2447: '{': missing function header (old-style formal list?)
qwindowsglcontext.cpp
qwindowsclipboard.cpp
qwindowsdrag.cpp
qwindowstabletsupport.cpp
Generating Code...
Compiling...
main.cpp
qwindowsbackingstore.cpp
qwindowsgdiintegration.cpp
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

最佳答案

看起来 Windows Kit 10.0.16299 在文件 Windows Kits\10\include\10.0.16299.0\winrt\Windows.ApplicationModel.Contacts.h 中有一个错误 - 没有定义DEPRECATEDENUMERATOR 情况下的宏

#if __cplusplus >= 201402
#define DEPRECATED(x) [[deprecated(x)]]
#elif defined(_MSC_VER)

要修复,请将此补丁应用到 qtbase:

diff --git a/src/plugins/platforms/windows/qwin10helpers.cpp b/src/plugins/platforms/windows/qwin10helpers.cpp
index cc17d8798f..51c2e6656c 100644
--- a/src/plugins/platforms/windows/qwin10helpers.cpp
+++ b/src/plugins/platforms/windows/qwin10helpers.cpp
@@ -53,6 +53,34 @@

#include <inspectable.h>

+
+#if !defined(DISABLE_WINRT_DEPRECATION)
+#if defined(__cplusplus)
+#if __cplusplus >= 201402
+#define DEPRECATED(x) [[deprecated(x)]]
+#define DEPRECATEDENUMERATOR(x) [[deprecated(x)]]
+#elif defined(_MSC_VER)
+#if _MSC_VER >= 1900
+#define DEPRECATED(x) [[deprecated(x)]]
+#define DEPRECATEDENUMERATOR(x) [[deprecated(x)]]
+#else
+#define DEPRECATED(x) __declspec(deprecated(x))
+#define DEPRECATEDENUMERATOR(x)
+#endif // _MSC_VER >= 1900
+#else // Not Standard C++ or MSVC, ignore the construct.
+#define DEPRECATED(x)
+#define DEPRECATEDENUMERATOR(x)
+#endif // C++ deprecation
+#else // C - disable deprecation
+#define DEPRECATED(x)
+#define DEPRECATEDENUMERATOR(x)
+#endif
+#else // Deprecation is disabled
+#define DEPRECATED(x)
+#define DEPRECATEDENUMERATOR(x)
+#endif /* DEPRECATED */
+
+
#ifdef HAS_UI_VIEW_SETTINGS
# include <windows.ui.viewmanagement.h>
#endif

关于windows - 为什么我在尝试构建 QT 的静态版本时遇到 NMAKE 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57565229/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com