Closed sere3925sere closed 1 year ago
I replaced #include <SDL/SDL.h> with #include
Strange. The include search dirs look okay'ish.
I'm wondering what SDL_audio.h
is included by SDL.h
.
Can you "break" your source again and compile with -E
?
This will only preprocess your source.
The output should contain #line
directives that show the full path of included files.
Allright, here is output. output.zip
Also I added this line
extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len);
in emsdk\upstream\emscripten\cache\sysroot\include\SDL2\SDL_audio.h
and in emsdk\upstream\emscripten\system\include\SDL\SDL_audio.h
Not sure if that made any difference. It still was broken until I changed #include to
You are including SDL/SDL.h
. That is the header of SDL 1.2, which is incompatible with SDL2.
(SDL3 is also incompatible with both of them)
You need to do #include <SDL2/SDL.h>
instead, or #include "SDL.h"
as you already did.
For safety, undo your changes to the SDL_audio.h
files.
The default SDL2 headers declare everything you need.
Test program, testsdl.c:
Version of emscripten/emsdk:
Failing command line in full:
Full link command and output with
-v
appended:SDL version:
Code for getting SDL version: