-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[MSVC] fatal error C1189: #error: "This version of XAudio2 is available only in Windows 8 or later. Use the XAudio2 headers and libraries from the DirectX SDK with applications that target Windows 7 and earlier versions." #9968
Comments
This issue is caused by the fact that Microsoft introduced a new version of Xaudio2 with Windows 8 that’s incompatible at the API level with the version included with DirectX for previous versions of Windows. The newer Windows SDKs include the headers and libraries for the new version of Xaudio2, but building an application against this API will make it incompatible with older versions of Windows. You gt this error because the MAME build scripts currently set the target Windows version to 600 (Windows Vista), but your compiler is finding the newer Xaudio2 header from the Windows SDK rather than the older Xaudio2 header from the DirectX SDK. You can fix the issue in one of these ways:
|
Hi @cuavas
You can check the detailed log: Also, I would like to add: I updated Mame on June 10th, and the error C1189 started to appear. Before that, the compilation was successful. And also I tried the commit 324f9d4 which is updated at 5/21/2022, the same steps (without option MODERN_WIN_API=1), it also built successfully. Could you please take a look? Thanks. |
I’ll take another look at MSVC project generation after the 0.245 release. The source structure has been reorganised, so things might have changed a bit. |
I tested with revision 875ee33. I used this command to generate Visual Studio projects:
The build succeeded for me. It’s possible you encountered issues with resource compilation under Visual Studio introduced around 74fe6e9 and fixed in 94c22aa (indirectly caused by bkaradzic/GENie#544). I added notes about issues affecting compilation with Visual Studio to our documentation in 8d4bbad (see it on our documentation web site here). This should hopefully help people in the future. |
Ok, thank you for your reply. I will update the commit to 875ee33 and have a try. |
I tried the commit 875ee33 and specified NOWERROR=1 MODERN_WIN_API=1 NO_USE_PORTAUDIO=1 to generate Visual Studio projects, it built successfully. Thanks. |
Issue description:
When I use msvc to build mame under the windows x64 platform, it failed with error like below:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\xaudio2.h(20,1): fatal error C1189: #error: "This version of XAudio2 is available only in Windows 8 or later. Use the XAudio2 headers and libraries from the DirectX SDK with applications that target Windows 7 and earlier versions." [F:\gitP\mamedev\mame\build\projects\windows\mametiny\vs2019\osd_windows.vcxproj]
Could you please help look this issue? Thanks.
Reproduce steps:
git -C "F:\gitP\mamedev\mame" rev-parse --git-dir
git -C "F:\gitP\mamedev\mame" clean -xdf
git -C "F:\gitP\mamedev\mame" fetch --recurse-submodules=no --force
git -C "F:\gitP\mamedev\mame" reset --hard 74fe6e9
git -C "F:\gitP\mamedev\mame" remote prune origin
git -C "F:\gitP\mamedev\mame" submodule sync
git -C "F:\gitP\mamedev\mame" submodule foreach git reset --hard
git -C "F:\gitP\mamedev\mame" submodule foreach git clean -xdf
git -C "F:\gitP\mamedev\mame" submodule update --init --recursive
msbuild /m /p:Platform=x64 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PreferredToolArchitecture=x64 mametiny.sln /t:Rebuild
Expected result:
build pass.
Actual result:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\xaudio2.h(20,1): fatal error C1189: #error: "This version of XAudio2 is available only in Windows 8 or later. Use the XAudio2 headers and libraries from the DirectX SDK with applications that target Windows 7 and earlier versions." [F:\gitP\mamedev\mame\build\projects\windows\mametiny\vs2019\osd_windows.vcxproj]
Detailed log:
build.log
The text was updated successfully, but these errors were encountered: