error message: "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include" "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0" "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror" "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields" -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP ../qga/commands-win32.c:62:24: error: redundant redeclaration of 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls] 62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW( | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../qga/commands-win32.c:26: C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note: previous declaration of 'CM_Get_DevNode_PropertyW' was here 840 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags); | ^~~~~~~~~~~~~~~~~~~~~~~~ cc1.exe: all warnings being treated as errors make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj] 错误 1 (已忽略)
This error comes from qemu configure didn't add predefined macro -DUNICODE -D_UNICODE in QEMU_CFLAGS, and these too macro are standard config for win32 if using windows wide api. in cfgmgr32.h CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags); #ifdef UNICODE #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW #endif macro CM_Get_DevNode_Property defined only when UNICODE are defined. and in win32, UNICODE and _UNICODE should be defined at the same time #endif Signed-off-by: Yonggang Luo <luoyongg...@gmail.com> --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 9f141891ea..f5d661af4a 100755 --- a/configure +++ b/configure @@ -812,6 +812,7 @@ MINGW32*) mingw32="yes" hax="yes" whpx="" + QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS" vhost_user="no" audio_possible_drivers="dsound sdl" if check_include dsound.h; then -- 2.28.0.windows.1