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

windows-audio.c compilation error with VS2019, VS2022 #4

Closed
voltagex opened this issue Dec 12, 2021 · 3 comments
Closed

windows-audio.c compilation error with VS2019, VS2022 #4

voltagex opened this issue Dec 12, 2021 · 3 comments

Comments

@voltagex
Copy link

C:\git\space-shooter>build.bat
assets\audio\Explode1.wav
assets\audio\Hit_Hurt2.wav
assets\audio\Jump1.wav
assets\audio\Laser_002.wav
assets\audio\music.wav
assets\shaders\fs.glsl
assets\shaders\vs.glsl
assets\sprites\enemy-big.bmp
assets\sprites\enemy-medium.bmp
assets\sprites\enemy-small.bmp
assets\sprites\explosion.bmp
assets\sprites\laser-bolts.bmp
assets\sprites\pixelspritefont32.bmp
assets\sprites\ship.bmp
14 File(s) copied

C:\git\space-shooter\build>cl /std:c11 /W4 /WX /wd5105 /wd4201 /wd4100 /D SOGL_MAJOR_VERSION=3 /D SOGL_MINOR_VERSION=3 /Fespace-shooter /Zi /D SPACE_SHOOTER_DEBUG ..\src\shared\*.c ..\src\game\*.c ..\src\platform\windows\*.c user32.lib gdi32.lib opengl32.lib xinput.lib ole32.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30705 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

data.c
entities.c
events.c
game.c
renderer.c
sprites.c
utils.c
windows-audio.c
..\src\platform\windows\windows-audio.c(81): error C2440: 'initializing': cannot convert from 'void (__cdecl *)(IXAudio2VoiceCallback *,UINT32)' to 'void (__stdcall *)(IXAudio2VoiceCallback *,UINT32)'
..\src\platform\windows\windows-audio.c(81): error C2440: 'initializing': cannot convert from 'void (__cdecl *)(IXAudio2VoiceCallback *)' to 'void (__stdcall *)(IXAudio2VoiceCallback *)'
..\src\platform\windows\windows-audio.c(81): error C2440: 'initializing': cannot convert from 'void (__cdecl *)(IXAudio2VoiceCallback *,void *)' to 'void (__stdcall *)(IXAudio2VoiceCallback *,void *)'
..\src\platform\windows\windows-audio.c(81): error C2440: 'initializing': cannot convert from 'void (__cdecl *)(IXAudio2VoiceCallback *,void *,HRESULT)' to 'void (__stdcall *)(IXAudio2VoiceCallback *,void *,HRESULT)'
windows.c
Generating Code...
C:\git\space-shooter>dir build


 Directory of C:\git\space-shooter\build

12/12/2021  01:41 PM    <DIR>          .
12/12/2021  01:41 PM    <DIR>          ..
12/12/2021  01:41 PM    <DIR>          assets
12/12/2021  01:41 PM             2,962 data.obj
12/12/2021  01:41 PM             8,044 entities.obj
12/12/2021  01:41 PM             7,104 events.obj
12/12/2021  01:41 PM           190,256 game.obj
12/12/2021  01:41 PM            30,857 renderer.obj
12/12/2021  01:41 PM            25,528 sprites.obj
12/12/2021  01:41 PM            12,625 utils.obj
12/12/2021  01:41 PM           118,784 vc140.pdb
12/12/2021  01:41 PM           154,138 windows.obj
@voltagex voltagex changed the title build.bat doesn't seem to generate exe with VS2022 windows-audio.c compilation error with VS2022 Dec 12, 2021
@voltagex voltagex changed the title windows-audio.c compilation error with VS2022 windows-audio.c compilation error with VS2019, VS2022 Dec 12, 2021
@voltagex
Copy link
Author

Weird, fails if I use the "Developer Command Prompt", succeeds if I use the "x64 Native Tools Prompt"

@tsherif
Copy link
Owner

tsherif commented Dec 12, 2021

This is interesting, thanks for reporting! I'll admit I did all my development with the 64-bit cl without thinking about it. I'll add a note the readme.

@tsherif
Copy link
Owner

tsherif commented Dec 12, 2021

TIL Win32 calling conventions: 95eb2e9

It should compile in the 32-bit developer command prompt now too. Thanks for reporting this!

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

No branches or pull requests

2 participants