Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile retroarch on msys2 ucrt64. #17367

Open
2 tasks done
Kreijstal opened this issue Jan 7, 2025 · 9 comments · May be fixed by #17369
Open
2 tasks done

Cannot compile retroarch on msys2 ucrt64. #17367

Kreijstal opened this issue Jan 7, 2025 · 9 comments · May be fixed by #17369

Comments

@Kreijstal
Copy link

Kreijstal commented Jan 7, 2025

Is there an existing issue for this?

  • This is a bug in RetroArch frontend
  • I have searched the existing issues

Description

Retro arch gets a syntax error because of new headers of mingw.

Expected behavior

It should compile.

Steps to reproduce the bug

install deps, git clone, configure, make.

Version/Commit

839b765

Bisect Results

No response

Check in the nightly version

I don't know

Platform & operating system

Windows 11

Affected Cores

No response

Environment information

MINGW64_NT-10.0-22631 windows 3.5.4-0bc1222b.x86_64 2024-12-05 09:27 UTC x86_64 Msys

Relevant log output

Details

CC audio/drivers/xaudio.c
audio/drivers/xaudio.c: In function 'xaudio2_new':
audio/drivers/xaudio.c:279:127: error: macro "IXAudio2_CreateMasteringVoice" requires 8 arguments, but only 7 given
  279 |    if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      |                                                                                                                               ^
In file included from audio/drivers/xaudio.h:21,
                 from audio/drivers/xaudio.c:39:
audio/drivers/xaudio29.h:617:9: note: macro "IXAudio2_CreateMasteringVoice" defined here
  617 | #define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory))
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from E:/msys64/ucrt64/include/winbase.h:2864,
                 from E:/msys64/ucrt64/include/windows.h:70,
                 from ./libretro-common/include/retro_miscellaneous.h:41,
                 from audio/drivers/xaudio.c:29:
audio/drivers/xaudio.c:279:15: error: 'IXAudio2_CreateMasteringVoice' undeclared (first use in this function); did you mean 'IXAudio2MasteringVoice'?
  279 |    if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
audio/drivers/xaudio.c:279:15: note: each undeclared identifier is reported only once for each function it appears in
audio/drivers/xaudio.c: In function 'xa_list_new':
audio/drivers/xaudio.c:497:4: error: implicit declaration of function 'IXAudio2_GetDeviceCount' [-Wimplicit-function-declaration]
  497 |    IXAudio2_GetDeviceCount(ixa2, &dev_count);
      |    ^~~~~~~~~~~~~~~~~~~~~~~
audio/drivers/xaudio.c:501:7: error: unknown type name 'XAUDIO2_DEVICE_DETAILS'; did you mean 'XAUDIO2_VOICE_DETAILS'?
  501 |       XAUDIO2_DEVICE_DETAILS dev_detail;
      |       ^~~~~~~~~~~~~~~~~~~~~~
      |       XAUDIO2_VOICE_DETAILS
audio/drivers/xaudio.c:502:11: error: implicit declaration of function 'IXAudio2_GetDeviceDetails'; did you mean 'IXAudio2Voice_GetVoiceDetails'? [-Wimplicit-function-declaration]
  502 |       if (IXAudio2_GetDeviceDetails(ixa2, i, &dev_detail) == S_OK)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~
      |           IXAudio2Voice_GetVoiceDetails
audio/drivers/xaudio.c:504:59: error: request for member 'DisplayName' in something not a structure or union
  504 |          char *str = utf16_to_utf8_string_alloc(dev_detail.DisplayName);
      |                                                           ^
make: *** [Makefile:209: obj-unix/release/audio/drivers/xaudio.o] Error 1

My assumption is that this wasn't defined in mingw yet, or that the mingw declarations changed, but I am not sure.

@viachaslavic
Copy link
Contributor

Could you please attach full build log and also the generated config.mk and config.h?

@Kreijstal
Copy link
Author

Kreijstal commented Jan 7, 2025

I see the code and oh

#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
   {
      wchar_t *temp = NULL;
      if (device)
         temp = utf8_to_utf16_string_alloc((const char*)list->elems[idx_found].userdata);

      if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, (LPCWSTR)(uintptr_t)temp, NULL, AudioCategory_GameEffects)))
      {
         free(temp);
         goto error;
      }
      if (temp)
         free(temp);
   }
#else
   if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      goto error;
#endif

It appears _WIN32_WINNT not being set despite being in win11 :)

config.mk and config.h

# cat config.mk
CC = /ucrt64/bin/gcc
CXX = /ucrt64/bin/g++
WINDRES = /ucrt64/bin/windres
MOC = E:/msys64/ucrt64/share/qt6/bin/moc
ASFLAGS = 
LDFLAGS = 
INCLUDE_DIRS = -I./deps/7zip
LIBRARY_DIRS = 
PACKAGE_NAME = retroarch
BUILD = 
PREFIX = /usr/local
HAVE_7ZIP = 1
HAVE_ACCESSIBILITY = 1
HAVE_AL = 0
HAVE_ALSA = 0
HAVE_ANGLE = 0
HAVE_AUDIOIO = 0
HAVE_AUDIOMIXER = 1
HAVE_AV_CHANNEL_LAYOUT = 1
HAVE_AVCODEC = 1
AVCODEC_LIBS = -lavcodec
HAVE_AVDEVICE = 1
AVDEVICE_LIBS = -lavdevice
HAVE_AVFORMAT = 1
AVFORMAT_LIBS = -lavformat
HAVE_AVUTIL = 1
AVUTIL_LIBS = -lavutil
HAVE_BLISSBOX = 1
HAVE_BLUETOOTH = 0
HAVE_BSV_MOVIE = 1
HAVE_BUILTINBEARSSL = 0
HAVE_BUILTINFLAC = 1
ifneq ($(C89_BUILD),1)
HAVE_BUILTINGLSLANG = 1
endif
HAVE_BUILTINMBEDTLS = 0
HAVE_BUILTINZLIB = 1
HAVE_C99 = 1
C99_CFLAGS = -std=gnu99
HAVE_CACA = 0
HAVE_CC = 1
HAVE_CC_RESAMPLER = 1
HAVE_CDROM = 1
HAVE_CG = 0
ifneq ($(CXX_BUILD),1)
HAVE_CHD = 1
endif
HAVE_CHEATS = 1
HAVE_CHECK = 0
HAVE_CHEEVOS = 1
HAVE_COMMAND = 1
HAVE_CONFIGFILE = 1
HAVE_CORE_INFO_CACHE = 1
HAVE_COREAUDIO3 = 0
ifneq ($(C89_BUILD),1)
HAVE_CRTSWITCHRES = 1
endif
HAVE_CXX = 1
HAVE_CXX11 = 1
CXX11_CFLAGS = -std=c++11
HAVE_CXX17 = 1
CXX17_CFLAGS = -std=c++17
ifneq ($(C89_BUILD),1)
HAVE_D3D10 = 1
endif
ifneq ($(C89_BUILD),1)
HAVE_D3D11 = 1
endif
ifneq ($(C89_BUILD),1)
HAVE_D3D12 = 1
endif
HAVE_D3D8 = 0
ifneq ($(C89_BUILD),1)
HAVE_D3D9 = 1
endif
D3D9_LIBS = -ld3d9
HAVE_D3DX = 1
HAVE_D3DX8 = 0
HAVE_D3DX9 = 1
D3DX9_LIBS = -ld3dx9
HAVE_DBUS = 0
HAVE_DEBUG = 0
HAVE_DINPUT = 1
DINPUT_LIBS = -ldinput8
ifneq ($(C89_BUILD),1)
HAVE_DISCORD = 1
endif
HAVE_DISPMANX = 0
HAVE_DR_MP3 = 1
HAVE_DRM = 0
HAVE_DRMINGW = 0
HAVE_DSOUND = 1
DSOUND_LIBS = -ldsound
HAVE_DSP_FILTER = 1
HAVE_DYLIB = 1
HAVE_DYNAMIC = 1
HAVE_DYNAMIC_EGL = 0
HAVE_EGL = 1
EGL_LIBS = -lEGL
HAVE_EXYNOS = 0
ifneq ($(C89_BUILD),1)
HAVE_FFMPEG = 1
endif
HAVE_FLAC = 1
FLAC_LIBS = -lFLAC
HAVE_FLOATHARD = 0
HAVE_FLOATSOFTFP = 0
HAVE_FONTCONFIG = 1
FONTCONFIG_CFLAGS = -IE:/msys64/ucrt64/include/freetype2 -IE:/msys64/ucrt64/include/libpng16 -IE:/msys64/ucrt64/include/harfbuzz -IE:/msys64/ucrt64/include/glib-2.0 -IE:/msys64/ucrt64/lib/glib-2.0/include
FONTCONFIG_LIBS = -lfontconfig -lfreetype
HAVE_FREETYPE = 1
FREETYPE_CFLAGS = -IE:/msys64/ucrt64/include/freetype2 -IE:/msys64/ucrt64/include/libpng16 -IE:/msys64/ucrt64/include/harfbuzz -IE:/msys64/ucrt64/include/glib-2.0 -IE:/msys64/ucrt64/lib/glib-2.0/include
FREETYPE_LIBS = -lfreetype
HAVE_GBM = 0
HAVE_GDI = 1
HAVE_GETADDRINFO = 1
HAVE_GETOPT_LONG = 0
HAVE_GFX_WIDGETS = 1
HAVE_GLSL = 1
ifneq ($(C89_BUILD),1)
HAVE_GLSLANG = 1
endif
GLSLANG_LIBS = -lglslang
HAVE_GLSLANG_GENERICCODEGEN = 1
GLSLANG_GENERICCODEGEN_LIBS = -lGenericCodeGen
HAVE_GLSLANG_HLSL = 0
HAVE_GLSLANG_MACHINEINDEPENDENT = 1
GLSLANG_MACHINEINDEPENDENT_LIBS = -lMachineIndependent
HAVE_GLSLANG_OGLCOMPILER = 0
HAVE_GLSLANG_OSDEPENDENT = 1
GLSLANG_OSDEPENDENT_LIBS = -lOSDependent
HAVE_GLSLANG_SPIRV = 1
GLSLANG_SPIRV_LIBS = -lSPIRV
HAVE_GLSLANG_SPIRV_TOOLS = 1
GLSLANG_SPIRV_TOOLS_LIBS = -lSPIRV-Tools
HAVE_GLSLANG_SPIRV_TOOLS_OPT = 1
GLSLANG_SPIRV_TOOLS_OPT_LIBS = -lSPIRV-Tools-opt
HAVE_HID = 0
HAVE_HLSL = 0
HAVE_IBXM = 1
HAVE_IFINFO = 1
HAVE_IMAGEVIEWER = 1
HAVE_JACK = 1
JACK_LIBS = -ljack64
HAVE_KMS = 0
HAVE_LANGEXTRA = 1
HAVE_LIBCHECK = 1
LIBCHECK_LIBS = -lcheck
HAVE_LIBRETRODB = 1
HAVE_LIBSHAKE = 0
HAVE_LIBUSB = 0
HAVE_LUA = 0
HAVE_MALI_FBDEV = 0
HAVE_MEMFD_CREATE = 0
HAVE_MENU = 1
HAVE_METAL = 0
HAVE_MICROPHONE = 1
HAVE_MIST = 0
HAVE_MMAP = 0
HAVE_MOC = 1
HAVE_MPV = 0
HAVE_NEAREST_RESAMPLER = 1
HAVE_NEON = 0
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETWORK_CMD = 1
HAVE_NETWORK_VIDEO = 0
ifneq ($(C89_BUILD),1)
HAVE_NETWORKGAMEPAD = 1
endif
HAVE_NETWORKING = 1
NETWORKING_LIBS = -lws2_32
HAVE_NOUNUSED = 1
NOUNUSED_CFLAGS = -Wno-unused-result
HAVE_NOUNUSED_VARIABLE = 1
NOUNUSED_VARIABLE_CFLAGS = -Wno-unused-variable
HAVE_NVDA = 1
HAVE_ODROIDGO2 = 0
HAVE_OMAP = 0
HAVE_ONLINE_UPDATER = 1
HAVE_OPENDINGUX_FBDEV = 0
HAVE_OPENGL = 1
OPENGL_LIBS = -lopengl32
ifneq ($(C89_BUILD),1)
HAVE_OPENGL_CORE = 1
endif
HAVE_OPENGL1 = 1
HAVE_OPENGLES = 0
HAVE_OPENGLES3 = 0
HAVE_OPENGLES3_1 = 0
HAVE_OPENGLES3_2 = 0
HAVE_OPENSSL = 1
OPENSSL_LIBS = -lssl -lcrypto
HAVE_OSMESA = 0
HAVE_OSS = 0
HAVE_OSS_BSD = 0
HAVE_OSS_LIB = 0
HAVE_OVERLAY = 1
HAVE_PARPORT = 0
HAVE_PATCH = 1
HAVE_PIPEWIRE = 0
HAVE_PLAIN_DRM = 0
HAVE_PRESERVE_DYLIB = 0
HAVE_PULSE = 0
ifneq ($(C89_BUILD),1)
HAVE_QT = 1
endif
HAVE_QT6CONCURRENT = 1
QT6CONCURRENT_CFLAGS = -IE:/msys64/ucrt64/include/qt6/QtConcurrent -IE:/msys64/ucrt64/include/qt6 -DQT_CONCURRENT_LIB -IE:/msys64/ucrt64/include/qt6/QtCore -DQT_CORE_LIB -IE:/msys64/ucrt64/share/qt6/mkspecs/win32-g++ -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -D_WIN64 -DMINGW_HAS_SECURE_API=1 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00
QT6CONCURRENT_LIBS = -lQt6Concurrent -lQt6Core
HAVE_QT6CORE = 1
QT6CORE_CFLAGS = -IE:/msys64/ucrt64/include/qt6/QtCore -IE:/msys64/ucrt64/include/qt6 -DQT_CORE_LIB -IE:/msys64/ucrt64/share/qt6/mkspecs/win32-g++ -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -D_WIN64 -DMINGW_HAS_SECURE_API=1 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00
QT6CORE_LIBS = -lQt6Core
HAVE_QT6GUI = 1
QT6GUI_CFLAGS = -IE:/msys64/ucrt64/include/qt6/QtGui -IE:/msys64/ucrt64/include/qt6 -DQT_GUI_LIB -IE:/msys64/ucrt64/include/qt6/QtCore -DQT_CORE_LIB -IE:/msys64/ucrt64/share/qt6/mkspecs/win32-g++ -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -D_WIN64 -DMINGW_HAS_SECURE_API=1 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00
QT6GUI_LIBS = -lQt6Gui -lQt6Core
HAVE_QT6NETWORK = 1
QT6NETWORK_CFLAGS = -IE:/msys64/ucrt64/include/qt6/QtNetwork -IE:/msys64/ucrt64/include/qt6 -DQT_NETWORK_LIB -IE:/msys64/ucrt64/include/qt6/QtCore -DQT_CORE_LIB -IE:/msys64/ucrt64/share/qt6/mkspecs/win32-g++ -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -D_WIN64 -DMINGW_HAS_SECURE_API=1 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00
QT6NETWORK_LIBS = -lQt6Network -lQt6Core
HAVE_QT6WIDGETS = 1
QT6WIDGETS_CFLAGS = -IE:/msys64/ucrt64/include/qt6/QtWidgets -IE:/msys64/ucrt64/include/qt6 -DQT_WIDGETS_LIB -IE:/msys64/ucrt64/include/qt6/QtGui -DQT_GUI_LIB -IE:/msys64/ucrt64/include/qt6/QtCore -DQT_CORE_LIB -IE:/msys64/ucrt64/share/qt6/mkspecs/win32-g++ -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -D_WIN64 -DMINGW_HAS_SECURE_API=1 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00
QT6WIDGETS_LIBS = -lQt6Widgets -lQt6Gui -lQt6Core
HAVE_RBMP = 1
HAVE_REWIND = 1
HAVE_RJPEG = 1
HAVE_ROAR = 0
HAVE_RPNG = 1
HAVE_RSOUND = 0
HAVE_RTGA = 1
HAVE_RUNAHEAD = 1
HAVE_RWAV = 1
HAVE_SAPI = 0
HAVE_SCREENSHOTS = 1
HAVE_SDL = 0
HAVE_SDL_DINGUX = 0
ifneq ($(C89_BUILD),1)
HAVE_SDL2 = 1
endif
SDL2_CFLAGS = -IE:/msys64/ucrt64/include/SDL2 -Dmain=SDL_main
SDL2_LIBS = -lmingw32 -mwindows -lSDL2main -lSDL2
ifneq ($(C89_BUILD),1)
HAVE_SHADERPIPELINE = 1
endif
HAVE_SIXEL = 0
ifneq ($(C89_BUILD),1)
HAVE_SLANG = 1
endif
HAVE_SOCKET_LEGACY = 0
ifneq ($(C89_BUILD),1)
HAVE_SPIRV_CROSS = 1
endif
HAVE_SR2 = 1
HAVE_SSA = 1
SSA_LIBS = -lfribidi -lass
HAVE_SSE = 0
ifneq ($(C89_BUILD),1)
HAVE_SSL = 1
endif
HAVE_STB_FONT = 1
HAVE_STB_IMAGE = 1
HAVE_STB_VORBIS = 1
HAVE_STDIN_CMD = 0
HAVE_STEAM = 0
HAVE_STRCASESTR = 0
HAVE_SUNXI = 0
HAVE_SWRESAMPLE = 1
SWRESAMPLE_LIBS = -lswresample
HAVE_SWSCALE = 1
SWSCALE_LIBS = -lswscale
HAVE_SYSTEMD = 0
HAVE_SYSTEMMBEDCRYPTO = 1
SYSTEMMBEDCRYPTO_LIBS = -lmbedcrypto
ifneq ($(C89_BUILD),1)
HAVE_SYSTEMMBEDTLS = 1
endif
SYSTEMMBEDTLS_LIBS = -lmbedtls
HAVE_SYSTEMMBEDX509 = 1
SYSTEMMBEDX509_LIBS = -lmbedx509
HAVE_TEST_DRIVERS = 1
HAVE_THREAD_STORAGE = 1
THREAD_STORAGE_LIBS = -lpthread
HAVE_THREADS = 1
THREADS_LIBS = -lpthread
HAVE_TRANSLATE = 1
HAVE_UDEV = 0
HAVE_UPDATE_ASSETS = 1
HAVE_UPDATE_CORE_INFO = 1
HAVE_UPDATE_CORES = 1
HAVE_V4L2 = 0
HAVE_VC_TEST = 0
HAVE_VG = 0
HAVE_VIDEO_FILTER = 1
HAVE_VIDEOCORE = 0
HAVE_VIDEOPROCESSOR = 0
HAVE_VIVANTE_FBDEV = 0
ifneq ($(C89_BUILD),1)
HAVE_VULKAN = 1
endif
HAVE_VULKAN_DISPLAY = 1
HAVE_WASAPI = 1
HAVE_WAYLAND = 0
HAVE_WAYLAND_CURSOR = 0
HAVE_WAYLAND_PROTOS = 0
HAVE_WAYLAND_SCANNER = 0
HAVE_WIFI = 0
HAVE_WINMM = 1
HAVE_WINRAWINPUT = 1
HAVE_X11 = 0
HAVE_XAUDIO = 1
HAVE_XDELTA = 1
HAVE_XINERAMA = 0
HAVE_XINPUT = 1
HAVE_XKBCOMMON = 0
HAVE_XRANDR = 0
HAVE_XSHM = 0
HAVE_XVIDEO = 0
HAVE_ZLIB = 1
ZLIB_LIBS = -lz
DATA_DIR = /usr/local/share
DYLIB_LIB = 
ASSETS_DIR = /usr/local/share/retroarch
FILTERS_DIR = /usr/local/share/retroarch
CORE_INFO_DIR = /usr/local/share/retroarch
BIN_DIR = /usr/local/bin
DOC_DIR = /usr/local/share/doc/retroarch
MAN_DIR = /usr/local/share/man
HAVE_QT6 = 1
OS = Win32
QT_VERSION = qt6
GLOBAL_CONFIG_DIR = /etc

topkek@ayylmai UCRT64 ~/git/RetroArch
# cat config.h
#ifndef QB_CONFIG_H__
#define QB_CONFIG_H__

#define PACKAGE_NAME "retroarch"
#define HAVE_7ZIP 1
#define HAVE_ACCESSIBILITY 1
/* #undef HAVE_AL */
/* #undef HAVE_ALSA */
/* #undef HAVE_ANGLE */
/* #undef HAVE_AUDIOIO */
#define HAVE_AUDIOMIXER 1
#define HAVE_AV_CHANNEL_LAYOUT 1
#define HAVE_AVCODEC 1
#define HAVE_AVDEVICE 1
#define HAVE_AVFORMAT 1
#define HAVE_AVUTIL 1
#define HAVE_BLISSBOX 1
/* #undef HAVE_BLUETOOTH */
#define HAVE_BSV_MOVIE 1
/* #undef HAVE_BUILTINBEARSSL */
#define HAVE_BUILTINFLAC 1
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_BUILTINGLSLANG 1
#endif
/* #undef HAVE_BUILTINMBEDTLS */
#define HAVE_BUILTINZLIB 1
#define HAVE_C99 1
/* #undef HAVE_CACA */
#define HAVE_CC 1
#define HAVE_CC_RESAMPLER 1
#define HAVE_CDROM 1
/* #undef HAVE_CG */
#ifndef CXX_BUILD
#define HAVE_CHD 1
#endif
#define HAVE_CHEATS 1
/* #undef HAVE_CHECK */
#define HAVE_CHEEVOS 1
#define HAVE_COMMAND 1
#define HAVE_CONFIGFILE 1
#define HAVE_CORE_INFO_CACHE 1
/* #undef HAVE_COREAUDIO3 */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_CRTSWITCHRES 1
#endif
#define HAVE_CXX 1
#define HAVE_CXX11 1
#define HAVE_CXX17 1
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_D3D10 1
#endif
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_D3D11 1
#endif
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_D3D12 1
#endif
/* #undef HAVE_D3D8 */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_D3D9 1
#endif
#define HAVE_D3DX 1
/* #undef HAVE_D3DX8 */
#define HAVE_D3DX9 1
/* #undef HAVE_DBUS */
/* #undef HAVE_DEBUG */
#define HAVE_DINPUT 1
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_DISCORD 1
#endif
/* #undef HAVE_DISPMANX */
#define HAVE_DR_MP3 1
/* #undef HAVE_DRM */
/* #undef HAVE_DRMINGW */
#define HAVE_DSOUND 1
#define HAVE_DSP_FILTER 1
#define HAVE_DYLIB 1
#define HAVE_DYNAMIC 1
/* #undef HAVE_DYNAMIC_EGL */
#define HAVE_EGL 1
/* #undef HAVE_EXYNOS */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_FFMPEG 1
#endif
#define HAVE_FLAC 1
/* #undef HAVE_FLOATHARD */
/* #undef HAVE_FLOATSOFTFP */
#define HAVE_FONTCONFIG 1
#define HAVE_FREETYPE 1
/* #undef HAVE_GBM */
#define HAVE_GDI 1
#define HAVE_GETADDRINFO 1
/* #undef HAVE_GETOPT_LONG */
#define HAVE_GFX_WIDGETS 1
#define HAVE_GLSL 1
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_GLSLANG 1
#endif
#define HAVE_GLSLANG_GENERICCODEGEN 1
/* #undef HAVE_GLSLANG_HLSL */
#define HAVE_GLSLANG_MACHINEINDEPENDENT 1
/* #undef HAVE_GLSLANG_OGLCOMPILER */
#define HAVE_GLSLANG_OSDEPENDENT 1
#define HAVE_GLSLANG_SPIRV 1
#define HAVE_GLSLANG_SPIRV_TOOLS 1
#define HAVE_GLSLANG_SPIRV_TOOLS_OPT 1
/* #undef HAVE_HID */
/* #undef HAVE_HLSL */
#define HAVE_IBXM 1
#define HAVE_IFINFO 1
#define HAVE_IMAGEVIEWER 1
#define HAVE_JACK 1
/* #undef HAVE_KMS */
#define HAVE_LANGEXTRA 1
#define HAVE_LIBCHECK 1
#define HAVE_LIBRETRODB 1
/* #undef HAVE_LIBSHAKE */
/* #undef HAVE_LIBUSB */
/* #undef HAVE_LUA */
/* #undef HAVE_MALI_FBDEV */
/* #undef HAVE_MEMFD_CREATE */
#define HAVE_MENU 1
/* #undef HAVE_METAL */
#define HAVE_MICROPHONE 1
/* #undef HAVE_MIST */
/* #undef HAVE_MMAP */
#define HAVE_MOC 1
/* #undef HAVE_MPV */
#define HAVE_NEAREST_RESAMPLER 1
/* #undef HAVE_NEON */
#define HAVE_NETPLAYDISCOVERY 1
#define HAVE_NETPLAYDISCOVERY 1
#define HAVE_NETWORK_CMD 1
/* #undef HAVE_NETWORK_VIDEO */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_NETWORKGAMEPAD 1
#endif
#define HAVE_NETWORKING 1
#define HAVE_NOUNUSED 1
#define HAVE_NOUNUSED_VARIABLE 1
#define HAVE_NVDA 1
/* #undef HAVE_ODROIDGO2 */
/* #undef HAVE_OMAP */
#define HAVE_ONLINE_UPDATER 1
/* #undef HAVE_OPENDINGUX_FBDEV */
#define HAVE_OPENGL 1
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_OPENGL_CORE 1
#endif
#define HAVE_OPENGL1 1
/* #undef HAVE_OPENGLES */
/* #undef HAVE_OPENGLES3 */
/* #undef HAVE_OPENGLES3_1 */
/* #undef HAVE_OPENGLES3_2 */
#define HAVE_OPENSSL 1
/* #undef HAVE_OSMESA */
/* #undef HAVE_OSS */
/* #undef HAVE_OSS_BSD */
/* #undef HAVE_OSS_LIB */
#define HAVE_OVERLAY 1
/* #undef HAVE_PARPORT */
#define HAVE_PATCH 1
/* #undef HAVE_PIPEWIRE */
/* #undef HAVE_PLAIN_DRM */
/* #undef HAVE_PRESERVE_DYLIB */
/* #undef HAVE_PULSE */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_QT 1
#endif
#define HAVE_QT6CONCURRENT 1
#define HAVE_QT6CORE 1
#define HAVE_QT6GUI 1
#define HAVE_QT6NETWORK 1
#define HAVE_QT6WIDGETS 1
#define HAVE_RBMP 1
#define HAVE_REWIND 1
#define HAVE_RJPEG 1
/* #undef HAVE_ROAR */
#define HAVE_RPNG 1
/* #undef HAVE_RSOUND */
#define HAVE_RTGA 1
#define HAVE_RUNAHEAD 1
#define HAVE_RWAV 1
/* #undef HAVE_SAPI */
#define HAVE_SCREENSHOTS 1
/* #undef HAVE_SDL */
/* #undef HAVE_SDL_DINGUX */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_SDL2 1
#endif
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_SHADERPIPELINE 1
#endif
/* #undef HAVE_SIXEL */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_SLANG 1
#endif
/* #undef HAVE_SOCKET_LEGACY */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_SPIRV_CROSS 1
#endif
#define HAVE_SR2 1
#define HAVE_SSA 1
/* #undef HAVE_SSE */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_SSL 1
#endif
#define HAVE_STB_FONT 1
#define HAVE_STB_IMAGE 1
#define HAVE_STB_VORBIS 1
/* #undef HAVE_STDIN_CMD */
/* #undef HAVE_STEAM */
/* #undef HAVE_STRCASESTR */
/* #undef HAVE_SUNXI */
#define HAVE_SWRESAMPLE 1
#define HAVE_SWSCALE 1
/* #undef HAVE_SYSTEMD */
#define HAVE_SYSTEMMBEDCRYPTO 1
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_SYSTEMMBEDTLS 1
#endif
#define HAVE_SYSTEMMBEDX509 1
#define HAVE_TEST_DRIVERS 1
#define HAVE_THREAD_STORAGE 1
#define HAVE_THREADS 1
#define HAVE_TRANSLATE 1
/* #undef HAVE_UDEV */
#define HAVE_UPDATE_ASSETS 1
#define HAVE_UPDATE_CORE_INFO 1
#define HAVE_UPDATE_CORES 1
/* #undef HAVE_V4L2 */
/* #undef HAVE_VC_TEST */
/* #undef HAVE_VG */
#define HAVE_VIDEO_FILTER 1
/* #undef HAVE_VIDEOCORE */
/* #undef HAVE_VIDEOPROCESSOR */
/* #undef HAVE_VIVANTE_FBDEV */
#if __cplusplus || __STDC_VERSION__ >= 199901L
#define HAVE_VULKAN 1
#endif
#define HAVE_VULKAN_DISPLAY 1
#define HAVE_WASAPI 1
/* #undef HAVE_WAYLAND */
/* #undef HAVE_WAYLAND_CURSOR */
/* #undef HAVE_WAYLAND_PROTOS */
/* #undef HAVE_WAYLAND_SCANNER */
/* #undef HAVE_WIFI */
#define HAVE_WINMM 1
#define HAVE_WINRAWINPUT 1
/* #undef HAVE_X11 */
#define HAVE_XAUDIO 1
#define HAVE_XDELTA 1
/* #undef HAVE_XINERAMA */
#define HAVE_XINPUT 1
/* #undef HAVE_XKBCOMMON */
/* #undef HAVE_XRANDR */
/* #undef HAVE_XSHM */
/* #undef HAVE_XVIDEO */
#define HAVE_ZLIB 1
#endif

looking at it closely HAVE_NVDA should also be 0, I do not own any nvidia hardware, it's an intel iGPU... inside a VM without GPU passthrough. (Yes, I have not configured the prefix yet, just checking if it compiles.)

Edit: I see now WIN32_WINNT=0x0A00 is defined for QT6 but not for everything else? huh.

Ah right, you asked a full build.log, I'll generate one, but spoiler alert, it's pretty much warning-free except that part, but I'll have to generate another one.

Edit: here it is

build.log

topkek@ayylmai UCRT64 ~/git/RetroArch
# make
CC version_git.c
CC frontend/frontend_driver.c
CC retroarch.c
CC runloop.c
CC ui/ui_companion_driver.c
CC camera/camera_driver.c
CC record/record_driver.c
CC record/drivers/record_wav.c
CC command.c
CC msg_hash.c
CC intl/msg_hash_us.c
CC libretro-common/queues/task_queue.c
CC tasks/task_content.c
CC tasks/task_patch.c
CC deps/xdelta3/xdelta3.c
In file included from deps/xdelta3/xdelta3.c:683:
In function 'djw_decode_1_2',
    inlined from 'djw_decode_prefix' at deps/xdelta3/xdelta3-djw.h:1626:10,
    inlined from 'xd3_decode_huff' at deps/xdelta3/xdelta3-djw.h:1712:18:
deps/xdelta3/xdelta3-djw.h:1561:23: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 1561 |           values[n++] = 0;
      |           ~~~~~~~~~~~~^~~
deps/xdelta3/xdelta3-djw.h: In function 'xd3_decode_huff':
deps/xdelta3/xdelta3-djw.h:1698:15: note: at offset 256 into destination object 'clen' of size 256
 1698 |       uint8_t clen      [DJW_MAX_GROUPS][ALPHABET_SIZE];
      |               ^~~~
CC save.c
CC tasks/task_save.c
CC tasks/task_movie.c
CC tasks/task_file_transfer.c
CC tasks/task_image.c
CC tasks/task_playlist_manager.c
CC tasks/task_manual_content_scan.c
CC tasks/task_core_backup.c
CC libretro-common/encodings/encoding_utf.c
CC libretro-common/encodings/encoding_crc32.c
CC libretro-common/encodings/encoding_base64.c
CC tasks/task_translation.c
CC libretro-common/compat/fopen_utf8.c
CC libretro-common/compat/compat_strldup.c
CC libretro-common/lists/file_list.c
CC libretro-common/lists/dir_list.c
CC libretro-common/file/retro_dirent.c
CC libretro-common/streams/stdin_stream.c
CC libretro-common/streams/file_stream.c
CC libretro-common/streams/file_stream_transforms.c
CC libretro-common/streams/interface_stream.c
CC libretro-common/streams/memory_stream.c
CC libretro-common/streams/network_stream.c
CC libretro-common/vfs/vfs_implementation.c
CC libretro-common/lists/string_list.c
CC libretro-common/string/stdstring.c
CC libretro-common/memmap/memalign.c
CC libretro-common/file/nbio/nbio_stdio.c
CC libretro-common/lists/linked_list.c
CC libretro-common/lists/nested_list.c
CC libretro-common/queues/generic_queue.c
CC libretro-common/file/nbio/nbio_windowsmmap.c
CC libretro-common/file/nbio/nbio_intf.c
CC libretro-common/file/file_path.c
CC libretro-common/file/file_path_io.c
CC file_path_special.c
CC libretro-common/hash/lrc_hash.c
CC audio/audio_driver.c
CC input/input_driver.c
CC input/common/input_hid_common.c
CC led/led_driver.c
CC gfx/video_driver.c
CC gfx/gfx_display.c
CC gfx/gfx_animation.c
CC configuration.c
CC libretro-common/dynamic/dylib.c
CC cores/dynamic_dummy.c
CC libretro-common/queues/message_queue.c
CC gfx/gfx_thumbnail_path.c
CC gfx/gfx_thumbnail.c
CC audio/microphone_driver.c
CC state_manager.c
CC gfx/drivers_font_renderer/bitmapfont.c
CC gfx/drivers_font_renderer/bitmapfont_10x10.c
CC gfx/drivers_font_renderer/bitmapfont_6x10.c
CC tasks/task_autodetect.c
CC input/input_autodetect_builtin.c
CC input/input_keymaps.c
CC libretro-common/queues/fifo_queue.c
CC libretro-common/compat/compat_fnmatch.c
CC libretro-common/compat/compat_posix_string.c
CC cheat_manager.c
CC core_info.c
CC core_backup.c
CC core_option_manager.c
CC libretro-common/file/config_file.c
CC libretro-common/file/config_file_userdata.c
CC runtime_file.c
CC disk_index_file.c
CC tasks/task_screenshot.c
CC tasks/task_powerstate.c
CC libretro-common/gfx/scaler/scaler.c
CC libretro-common/gfx/scaler/pixconv.c
CC libretro-common/gfx/scaler/scaler_int.c
CC libretro-common/gfx/scaler/scaler_filter.c
CC gfx/font_driver.c
CC gfx/video_filter.c
CC libretro-common/audio/resampler/audio_resampler.c
CC libretro-common/audio/dsp_filter.c
CC libretro-common/audio/resampler/drivers/sinc_resampler.c
CC libretro-common/audio/resampler/drivers/nearest_resampler.c
CC libretro-common/utils/md5.c
CC playlist.c
CC libretro-common/features/features_cpu.c
CC verbosity.c
CC libretro-common/playlists/label_sanitization.c
CC libretro-common/time/rtime.c
CC manual_content_scan.c
CC disk_control_interface.c
CC tasks/task_autodetect_blissbox.c
CC tasks/task_audio_mixer.c
CC libretro-common/audio/audio_mix.c
CC libretro-common/audio/audio_mixer.c
CC runahead.c
CC audio/drivers_resampler/cc_resampler.c
CC libretro-common/compat/compat_getopt.c
CC libretro-common/compat/compat_strcasestr.c
CC libretro-common/compat/compat_strl.c
CC libretro-common/formats/image_texture.c
CC cores/libretro-imageviewer/image_core.c
CXX ui/drivers/ui_qt.cpp
CXX ui/drivers/qt/gridview.cpp
CXX ui/drivers/qt/qt_dialogs.cpp
CXX ui/drivers/qt/qt_widgets.cpp
CXX ui/drivers/qt/qt_playlist.cpp
CXX ui/drivers/qt/qt_downloads.cpp
CXX ui/drivers/qt/qt_options.cpp
CC libretro-db/bintree.c
CC libretro-db/libretrodb.c
CC libretro-db/query.c
CC libretro-db/rmsgpack.c
CC libretro-db/rmsgpack_dom.c
CC database_info.c
CC tasks/task_database.c
CC tasks/task_database_cue.c
CC menu/menu_explore.c
CC tasks/task_menu_explore.c
CC audio/drivers/jack.c
CC audio/drivers/dsound.c
CC audio/drivers/wasapi.c
CC audio/common/wasapi.c
CC audio/drivers_microphone/wasapi.c
CC audio/drivers/xaudio.c
audio/drivers/xaudio.c: In function 'xaudio2_new':
audio/drivers/xaudio.c:279:127: error: macro "IXAudio2_CreateMasteringVoice" requires 8 arguments, but only 7 given
  279 |    if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      |                                                                                                                               ^
In file included from audio/drivers/xaudio.h:21,
                 from audio/drivers/xaudio.c:39:
audio/drivers/xaudio29.h:617:9: note: macro "IXAudio2_CreateMasteringVoice" defined here
  617 | #define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory))
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from E:/msys64/ucrt64/include/winbase.h:2864,
                 from E:/msys64/ucrt64/include/windows.h:70,
                 from ./libretro-common/include/retro_miscellaneous.h:41,
                 from audio/drivers/xaudio.c:29:
audio/drivers/xaudio.c:279:15: error: 'IXAudio2_CreateMasteringVoice' undeclared (first use in this function); did you mean 'IXAudio2MasteringVoice'?
  279 |    if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
audio/drivers/xaudio.c:279:15: note: each undeclared identifier is reported only once for each function it appears in
audio/drivers/xaudio.c: In function 'xa_list_new':
audio/drivers/xaudio.c:497:4: error: implicit declaration of function 'IXAudio2_GetDeviceCount' [-Wimplicit-function-declaration]
  497 |    IXAudio2_GetDeviceCount(ixa2, &dev_count);
      |    ^~~~~~~~~~~~~~~~~~~~~~~
audio/drivers/xaudio.c:501:7: error: unknown type name 'XAUDIO2_DEVICE_DETAILS'; did you mean 'XAUDIO2_VOICE_DETAILS'?
  501 |       XAUDIO2_DEVICE_DETAILS dev_detail;
      |       ^~~~~~~~~~~~~~~~~~~~~~
      |       XAUDIO2_VOICE_DETAILS
audio/drivers/xaudio.c:502:11: error: implicit declaration of function 'IXAudio2_GetDeviceDetails'; did you mean 'IXAudio2Voice_GetVoiceDetails'? [-Wimplicit-function-declaration]
  502 |       if (IXAudio2_GetDeviceDetails(ixa2, i, &dev_detail) == S_OK)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~
      |           IXAudio2Voice_GetVoiceDetails
audio/drivers/xaudio.c:504:59: error: request for member 'DisplayName' in something not a structure or union
  504 |          char *str = utf16_to_utf8_string_alloc(dev_detail.DisplayName);
      |                                                           ^
make: *** [Makefile:209: obj-unix/release/audio/drivers/xaudio.o] Error 1

@viachaslavic
Copy link
Contributor

Edit: I see now WIN32_WINNT=0x0A00 is defined for QT6 but not for everything else? huh.

It is added globally for C++ compiler, but not for the C compiler. Do you have a CC override?

@Kreijstal
Copy link
Author

Kreijstal commented Jan 7, 2025

Edit: I see now WIN32_WINNT=0x0A00 is defined for QT6 but not for everything else? huh.

It is added globally for C++ compiler, but not for the C compiler. Do you have a CC override?

not that I know of.. CC is empty, also, strange I tried harcoding the version in $CFLAGS, and I seem to get the same error. But I can't seem to get the compilation flags with VERBOSE=1 make

Edit: it was V=1

# V=1 make
/ucrt64/bin/gcc  -D_WIN32_WINNT=0x0A00 -std=gnu99 -D_GNU_SOURCE -I. -ffast-math -Wall -Wsign-compare -Wno-unused-result -Wno-unused-variable -finput-charset=UTF-8    -IE:/msys64/ucrt64/include/freetype2 -IE:/msys64/ucrt64/include/libpng16 -IE:/msys64/ucrt64/include/harfbuzz -IE:/msys64/ucrt64/include/glib-2.0 -IE:/msys64/ucrt64/lib/glib-2.0/include -IE:/msys64/ucrt64/include/freetype2 -IE:/msys64/ucrt64/include/libpng16 -IE:/msys64/ucrt64/include/harfbuzz -IE:/msys64/ucrt64/include/glib-2.0 -IE:/msys64/ucrt64/lib/glib-2.0/include -IE:/msys64/ucrt64/include/SDL2 -Dmain=SDL_main -Wno-unknown-pragmas      -Wno-deprecated-declarations -I./deps/7zip -I./libretro-common/include -I./deps -I./deps/xdelta3 -I./libretro-common -I./deps  -Igfx/include -isystemgfx/include/dxsdk -I./deps/glslang/glslang/glslang/OSDependent/Windows -I./deps/glslang/glslang/OGLCompilersDLL -I./deps/glslang/glslang/glslang/MachineIndependent -I./deps/glslang/glslang/glslang/Public -I./deps/glslang/glslang/SPIRV -I./deps/SPIRV-Cross -I./deps/7zip -I./deps -I./deps/libFLAC/include -I./libretro-common/include/compat/zlib -I./libretro-common/formats/libchdr -Ideps/rcheevos/include -Ideps/discord-rpc/include -Iffmpeg -I./deps/switchres -Ideps -Ideps/stb -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -DGLOBAL_CONFIG_DIR='"/etc"' -DASSETS_DIR='"/usr/local/share/retroarch"' -DFILTERS_DIR='"/usr/local/share/retroarch"' -DCORE_INFO_DIR='"/usr/local/share/retroarch"' -DHAVE_LIBRETRODB -DHAVE_DYLIB -DHAVE_FILE_LOGGER -DHAVE_SHADERPIPELINE -DHAVE_NETPLAYDISCOVERY -DHAVE_GIT_VERSION -DGIT_VERSION=839b7654db -DHAVE_DR_MP3 -DHAVE_PATCH -DHAVE_XDELTA -DSECONDARY_DJW -DSECONDARY_LZMA -DSECONDARY_FGK -DHAVE_MICROPHONE -DHAVE_REWIND -DHAVE_CHEATS -DHAVE_CORE_INFO_CACHE -DHAVE_SCREENSHOTS -DHAVE_VIDEO_FILTER -DHAVE_DSP_FILTER -DHAVE_NEAREST_RESAMPLER -DHAVE_CONFIGFILE -DHAVE_BLISSBOX -DHAVE_AUDIOMIXER -DHAVE_BSV_MOVIE -DHAVE_RUNAHEAD -DHAVE_CC_RESAMPLER -DHAVE_LANGEXTRA -DHAVE_IMAGEVIEWER -DHAVE_MAIN -DHAVE_SSL -DHAVE_COMMAND -DHAVE_DSOUND -DHAVE_WASAPI -DHAVE_XAUDIO -DHAVE_WINMM -DHAVE_RWAV -DHAVE_MENU -DHAVE_GFX_WIDGETS -DHAVE_RGUI -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_OZONE -DHAVE_OVERLAY -DHAVE_STB_FONT -DHAVE_THREADS -DHAVE_THREAD_STORAGE -DHAVE_DINPUT -DHAVE_XINPUT -DHAVE_WINRAWINPUT -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GL_FFT -DHAVE_GL_SYNC -DHAVE_EGL -DHAVE_VULKAN -DHAVE_OPENGL_CORE -DHAVE_D3D9 -DHAVE_D3D10 -DHAVE_D3D11 -DHAVE_D3D12 -DHAVE_D3DX -DHAVE_D3D9 -DHAVE_D3D -DHAVE_GLSL -DHAVE_HLSL -DHAVE_SLANG -DHAVE_BUILTINGLSLANG -DHAVE_GLSLANG -DHAVE_SPIRV_CROSS -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_IBXM -DHAVE_FLAC -DHAVE_DR_FLAC  -DHAVE_STDINT_H -DHAVE_LROUND -DFLAC__HAS_OGG=0 -DFLAC_PACKAGE_VERSION="\"retroarch\"" -DHAVE_FSEEKO -DNEED_UTF8_SUPPORT -DHAVE_ZLIB -DHAVE_CHD -DWANT_SUBCODE -DWANT_RAW_DATA_SECTOR -DHAVE_CDROM -DHAVE_RTGA -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_ACCESSIBILITY -DHAVE_NETWORKING -DHAVE_CLOUDSYNC -DHAVE_IFINFO -DHAVE_NETWORK_CMD -DHAVE_CHEEVOS -DRC_CLIENT_SUPPORTS_HASH -DRC_DISABLE_LUA -DHAVE_DISCORD -DHAVE_TRANSLATE -DHAVE_FFMPEG -DSR_WIN32_STATIC -DHAVE_COMPRESSION -DHAVE_TEST_DRIVERS -DHAVE_PRESENCE -MMD -c -o obj-unix/release/audio/drivers/xaudio.o audio/drivers/xaudio.c
audio/drivers/xaudio.c: In function 'xaudio2_new':
audio/drivers/xaudio.c:279:127: error: macro "IXAudio2_CreateMasteringVoice" requires 8 arguments, but only 7 given
  279 |    if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      |                                                                                                                               ^
In file included from audio/drivers/xaudio.h:21,
                 from audio/drivers/xaudio.c:39:
audio/drivers/xaudio29.h:617:9: note: macro "IXAudio2_CreateMasteringVoice" defined here
  617 | #define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory))
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from E:/msys64/ucrt64/include/winbase.h:2864,
                 from E:/msys64/ucrt64/include/windows.h:70,
                 from ./libretro-common/include/retro_miscellaneous.h:41,
                 from audio/drivers/xaudio.c:29:
audio/drivers/xaudio.c:279:15: error: 'IXAudio2_CreateMasteringVoice' undeclared (first use in this function); did you mean 'IXAudio2MasteringVoice'?
  279 |    if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
audio/drivers/xaudio.c:279:15: note: each undeclared identifier is reported only once for each function it appears in
audio/drivers/xaudio.c: In function 'xa_list_new':
audio/drivers/xaudio.c:497:4: error: implicit declaration of function 'IXAudio2_GetDeviceCount' [-Wimplicit-function-declaration]
  497 |    IXAudio2_GetDeviceCount(ixa2, &dev_count);
      |    ^~~~~~~~~~~~~~~~~~~~~~~
audio/drivers/xaudio.c:501:7: error: unknown type name 'XAUDIO2_DEVICE_DETAILS'; did you mean 'XAUDIO2_VOICE_DETAILS'?
  501 |       XAUDIO2_DEVICE_DETAILS dev_detail;
      |       ^~~~~~~~~~~~~~~~~~~~~~
      |       XAUDIO2_VOICE_DETAILS
audio/drivers/xaudio.c:502:11: error: implicit declaration of function 'IXAudio2_GetDeviceDetails'; did you mean 'IXAudio2Voice_GetVoiceDetails'? [-Wimplicit-function-declaration]
  502 |       if (IXAudio2_GetDeviceDetails(ixa2, i, &dev_detail) == S_OK)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~
      |           IXAudio2Voice_GetVoiceDetails
audio/drivers/xaudio.c:504:59: error: request for member 'DisplayName' in something not a structure or union
  504 |          char *str = utf16_to_utf8_string_alloc(dev_detail.DisplayName);
      |                                                           ^
make: *** [Makefile:209: obj-unix/release/audio/drivers/xaudio.o] Error 1

Edit: it seems the NT define is a red herring, I get the same error despite it being clearly defined. /ucrt64/bin/gcc -D_WIN32_WINNT=0x0A00

I understand it gets undefined and redefined along the way.

# V=1 make
/ucrt64/bin/gcc  -D_WIN32_WINNT=0x0A00 -std=gnu99 -D_GNU_SOURCE -I. -ffast-math -Wall -Wsign-compare -Wno-unused-result -Wno-unused-variable -finput-charset=UTF-8    -IE:/msys64/ucrt64/include/freetype2 -IE:/msys64/ucrt64/include/libpng16 -IE:/msys64/ucrt64/include/harfbuzz -IE:/msys64/ucrt64/include/glib-2.0 -IE:/msys64/ucrt64/lib/glib-2.0/include -IE:/msys64/ucrt64/include/freetype2 -IE:/msys64/ucrt64/include/libpng16 -IE:/msys64/ucrt64/include/harfbuzz -IE:/msys64/ucrt64/include/glib-2.0 -IE:/msys64/ucrt64/lib/glib-2.0/include -IE:/msys64/ucrt64/include/SDL2 -Dmain=SDL_main -Wno-unknown-pragmas      -Wno-deprecated-declarations -I./deps/7zip -I./libretro-common/include -I./deps -I./deps/xdelta3 -I./libretro-common -I./deps  -Igfx/include -isystemgfx/include/dxsdk -I./deps/glslang/glslang/glslang/OSDependent/Windows -I./deps/glslang/glslang/OGLCompilersDLL -I./deps/glslang/glslang/glslang/MachineIndependent -I./deps/glslang/glslang/glslang/Public -I./deps/glslang/glslang/SPIRV -I./deps/SPIRV-Cross -I./deps/7zip -I./deps -I./deps/libFLAC/include -I./libretro-common/include/compat/zlib -I./libretro-common/formats/libchdr -Ideps/rcheevos/include -Ideps/discord-rpc/include -Iffmpeg -I./deps/switchres -Ideps -Ideps/stb -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -DGLOBAL_CONFIG_DIR='"/etc"' -DASSETS_DIR='"/usr/local/share/retroarch"' -DFILTERS_DIR='"/usr/local/share/retroarch"' -DCORE_INFO_DIR='"/usr/local/share/retroarch"' -DHAVE_LIBRETRODB -DHAVE_DYLIB -DHAVE_FILE_LOGGER -DHAVE_SHADERPIPELINE -DHAVE_NETPLAYDISCOVERY -DHAVE_GIT_VERSION -DGIT_VERSION=839b7654db -DHAVE_DR_MP3 -DHAVE_PATCH -DHAVE_XDELTA -DSECONDARY_DJW -DSECONDARY_LZMA -DSECONDARY_FGK -DHAVE_MICROPHONE -DHAVE_REWIND -DHAVE_CHEATS -DHAVE_CORE_INFO_CACHE -DHAVE_SCREENSHOTS -DHAVE_VIDEO_FILTER -DHAVE_DSP_FILTER -DHAVE_NEAREST_RESAMPLER -DHAVE_CONFIGFILE -DHAVE_BLISSBOX -DHAVE_AUDIOMIXER -DHAVE_BSV_MOVIE -DHAVE_RUNAHEAD -DHAVE_CC_RESAMPLER -DHAVE_LANGEXTRA -DHAVE_IMAGEVIEWER -DHAVE_MAIN -DHAVE_SSL -DHAVE_COMMAND -DHAVE_DSOUND -DHAVE_WASAPI -DHAVE_XAUDIO -DHAVE_WINMM -DHAVE_RWAV -DHAVE_MENU -DHAVE_GFX_WIDGETS -DHAVE_RGUI -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_OZONE -DHAVE_OVERLAY -DHAVE_STB_FONT -DHAVE_THREADS -DHAVE_THREAD_STORAGE -DHAVE_DINPUT -DHAVE_XINPUT -DHAVE_WINRAWINPUT -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GL_FFT -DHAVE_GL_SYNC -DHAVE_EGL -DHAVE_VULKAN -DHAVE_OPENGL_CORE -DHAVE_D3D9 -DHAVE_D3D10 -DHAVE_D3D11 -DHAVE_D3D12 -DHAVE_D3DX -DHAVE_D3D9 -DHAVE_D3D -DHAVE_GLSL -DHAVE_HLSL -DHAVE_SLANG -DHAVE_BUILTINGLSLANG -DHAVE_GLSLANG -DHAVE_SPIRV_CROSS -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_IBXM -DHAVE_FLAC -DHAVE_DR_FLAC  -DHAVE_STDINT_H -DHAVE_LROUND -DFLAC__HAS_OGG=0 -DFLAC_PACKAGE_VERSION="\"retroarch\"" -DHAVE_FSEEKO -DNEED_UTF8_SUPPORT -DHAVE_ZLIB -DHAVE_CHD -DWANT_SUBCODE -DWANT_RAW_DATA_SECTOR -DHAVE_CDROM -DHAVE_RTGA -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_ACCESSIBILITY -DHAVE_NETWORKING -DHAVE_CLOUDSYNC -DHAVE_IFINFO -DHAVE_NETWORK_CMD -DHAVE_CHEEVOS -DRC_CLIENT_SUPPORTS_HASH -DRC_DISABLE_LUA -DHAVE_DISCORD -DHAVE_TRANSLATE -DHAVE_FFMPEG -DSR_WIN32_STATIC -DHAVE_COMPRESSION -DHAVE_TEST_DRIVERS -DHAVE_PRESENCE -MMD -c -o obj-unix/release/audio/drivers/xaudio.o audio/drivers/xaudio.c
audio/drivers/xaudio.c: In function 'xaudio2_new':
audio/drivers/xaudio.c:267:9: note: '#pragma message: The value of _WIN32_WINNT is: 0x0600'
  267 | #pragma message ("The value of _WIN32_WINNT is: " XSTR(_WIN32_WINNT))
      |         ^~~~~~~
audio/drivers/xaudio.c:283:127: error: macro "IXAudio2_CreateMasteringVoice" requires 8 arguments, but only 7 g

I added a secret pragma message to find out, and it gets rewritten to 0x0600
edit:
It seems mmdevice_common_inline.h likes changing the windows version

audio/common/mmdevice_common_inline.h:#define _WIN32_WINNT 0x0600
deps/xxHash/tests/collisions/threading.h:#define _WIN32_WINNT 0x0600

/* Fix for MSYS2 increasing _WIN32_WINNT to 0x0603*/
#if defined(__MINGW32__) || defined(__MINGW64__)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN
#else

Well, I guess when using msys2, it defaults to 0x0600, but in that case you should do that before loading the windows.h

@viachaslavic
Copy link
Contributor

Sorry to bother you, but does compilation succeed with --disable-qt?

make clean
./configure --disable-qt
make -j$(nproc)

@viachaslavic
Copy link
Contributor

Also please tell why you are using the ucrt64 shell instead of mingw64? In mingw64 should probably compile without errors

@Kreijstal
Copy link
Author

Kreijstal commented Jan 7, 2025

Also please tell why you are using the ucrt64 shell instead of mingw64? In mingw64 should probably compile without errors

mingw64 is "deprecated", ucrt64 uses the ucrt64 which comes from windows 8.1. I will try with mingw64, but I don't expect much difference, let me try.

Further links:

@Kreijstal
Copy link
Author

Kreijstal commented Jan 7, 2025

Trying mingw64 on win11 with latest msys2: (pacman -Syu)
(Also I left the pragma message there.)

audio/drivers/xaudio.c: In function 'xaudio2_new':
audio/drivers/xaudio.c:267:9: note: '#pragma message: The value of _WIN32_WINNT is: 0x0600'
  267 | #pragma message ("The value of _WIN32_WINNT is: " XSTR(_WIN32_WINNT))
      |         ^~~~~~~
audio/drivers/xaudio.c:283:127: error: macro "IXAudio2_CreateMasteringVoice" requires 8 arguments, but only 7 given
  283 |    if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      |                                                                                                                               ^
In file included from audio/drivers/xaudio.h:21,
                 from audio/drivers/xaudio.c:39:
audio/drivers/xaudio29.h:617:9: note: macro "IXAudio2_CreateMasteringVoice" defined here
  617 | #define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory))
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC libretro-common/audio/conversion/float_to_s16.c
In file included from E:/msys64/mingw64/include/winbase.h:2864,
                 from E:/msys64/mingw64/include/windows.h:70,
                 from ./libretro-common/include/retro_miscellaneous.h:41,
                 from audio/drivers/xaudio.c:29:
audio/drivers/xaudio.c:283:15: error: 'IXAudio2_CreateMasteringVoice' undeclared (first use in this function); did you mean 'IXAudio2MasteringVoice'?
  283 |    if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, idx_found, NULL)))
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
audio/drivers/xaudio.c:283:15: note: each undeclared identifier is reported only once for each function it appears in
audio/drivers/xaudio.c: In function 'xa_list_new':
audio/drivers/xaudio.c:501:4: error: implicit declaration of function 'IXAudio2_GetDeviceCount' [-Wimplicit-function-declaration]
  501 |    IXAudio2_GetDeviceCount(ixa2, &dev_count);
      |    ^~~~~~~~~~~~~~~~~~~~~~~
audio/drivers/xaudio.c:505:7: error: unknown type name 'XAUDIO2_DEVICE_DETAILS'; did you mean 'XAUDIO2_VOICE_DETAILS'?
  505 |       XAUDIO2_DEVICE_DETAILS dev_detail;
      |       ^~~~~~~~~~~~~~~~~~~~~~
      |       XAUDIO2_VOICE_DETAILS
audio/drivers/xaudio.c:506:11: error: implicit declaration of function 'IXAudio2_GetDeviceDetails'; did you mean 'IXAudio2Voice_GetVoiceDetails'? [-Wimplicit-function-declaration]
  506 |       if (IXAudio2_GetDeviceDetails(ixa2, i, &dev_detail) == S_OK)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~
      |           IXAudio2Voice_GetVoiceDetails
audio/drivers/xaudio.c:508:59: error: request for member 'DisplayName' in something not a structure or union
  508 |          char *str = utf16_to_utf8_string_alloc(dev_detail.DisplayName);
      |                                                           ^
make: *** [Makefile:207: obj-unix/release/audio/drivers/xaudio.o] Error 1
make: *** Waiting for unfinished jobs....
CC libretro-common/audio/conversion/mono_to_stereo_float.c

qt was disabled.

@Kreijstal
Copy link
Author

Kreijstal commented Jan 7, 2025

Alright

diff --git a/audio/common/mmdevice_common_inline.h b/audio/common/mmdevice_common_inline.h
index 255fdf5c9d..4ac8176c88 100644
--- a/audio/common/mmdevice_common_inline.h
+++ b/audio/common/mmdevice_common_inline.h
@@ -20,10 +20,6 @@
 
 /* Fix for MSYS2 increasing _WIN32_WINNT to 0x0603*/
 #if defined(__MINGW32__) || defined(__MINGW64__)
-#ifdef _WIN32_WINNT
-#undef _WIN32_WINNT
-#endif
-#define _WIN32_WINNT 0x0600
 #define WIN32_LEAN_AND_MEAN
 #else
 typedef enum EDataFlow EDataFlow;

I managed to make it compile!..

I think the problem was: msys2 updated to a newer version of windows, but mingw had a bug where it didnt implement the new windows 8.1 API but it provided the old API, this was a mismatch between mingw, and MSVC, a bug in mingw, and this was a monkeypatch to make it compile, it seems the bug was alerady fixed on mingw, and you can target higuer windows versions in mingw. This isn't needed anymore. In case you wanted a binary compatible binary for compatibility with windows 7 compiled with windows 11, you'd have to define the NT target before in your configuration, not hardcode it in the headers.

Edit: both mingw64 and ucrt64 compile, ucrt64 has a linking problem however that mingw doesn't have audio/drivers/xaudio.o:xaudio.c:(.text+0x44b): undefined reference to `__imp_XAudio2Create'

This reminds me of a manifest issue. I'll try to solve it

Solved:
We have to link -lxaudio2_9 from the ucrt.

Kreijstal added a commit to Kreijstal/RetroArch that referenced this issue Jan 7, 2025
## Description
Before there was no clear way of running msys2, and even if there was, there is no guarantee of it working, well I fixed it, and added a CI, so that we can always know if it works. Furthermore I added 2 targets more: UCRT64 and CLANG64, yes, compilation with clang64 means we can also compile with clang for windows on arm :D, plus clang has better error messages overall, anyway.

## Related Issues

libretro#17367

## Reviewers
Anyone, it's my first PR here.
@Kreijstal Kreijstal linked a pull request Jan 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants