Compiling SDL3 With VisualStudio2013 for Windows XP gives errors

The errors are the following:

1>------ Build started: Project: SDL3, Configuration: Debug Win32 ------
1> SDL_camera_mediafoundation.c
1> SDL_windowsevents.c
1> SDL_windowsmodes.c
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(164): warning C4013: ‘IMFSourceReader_ReadSample’ undefined; assuming extern returning int
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(164): error C2065: ‘MF_SOURCE_READER_FIRST_VIDEO_STREAM’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(175): error C2065: ‘MF_SOURCE_READERF_ERROR’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(175): error C2065: ‘MF_SOURCE_READERF_ENDOFSTREAM’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(449): warning C4013: ‘IMFSourceReader_Release’ undefined; assuming extern returning int
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(541): error C2065: ‘MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(541): warning C4133: ‘function’ : incompatible types - from ‘int *’ to 'const GUID *const ’
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(541): error C2065: ‘MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(544): error C2065: ‘MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(544): warning C4133: ‘function’ : incompatible types - from ‘int *’ to 'const GUID *const ’
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(579): warning C4013: ‘IMFSourceReader_SetCurrentMediaType’ undefined; assuming extern returning int
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(579): error C2065: ‘MF_SOURCE_READER_FIRST_VIDEO_STREAM’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(781): error C2065: ‘MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(781): warning C4133: ‘function’ : incompatible types - from ‘int *’ to ‘const GUID *’
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(788): error C2065: ‘MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(788): warning C4133: ‘function’ : incompatible types - from ‘int *’ to ‘const GUID *’
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(821): error C2065: ‘MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE’ : undeclared identifier
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(821): warning C4133: ‘function’ : incompatible types - from ‘int *’ to 'const GUID *const ’
1>…..\src\camera\mediafoundation\SDL_camera_mediafoundation.c(821): error C2065: ‘MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsevents.c(632): error C2065: ‘RI_MOUSE_HWHEEL’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(409): warning C4013: ‘GetDisplayConfigBufferSizes’ undefined; assuming extern returning int
1>…..\src\video\windows\SDL_windowsmodes.c(425): warning C4013: ‘QueryDisplayConfig’ undefined; assuming extern returning int
1>…..\src\video\windows\SDL_windowsmodes.c(438): warning C4013: ‘DisplayConfigGetDeviceInfo’ undefined; assuming extern returning int
1>…..\src\video\windows\SDL_windowsmodes.c(461): error C2065: ‘DISPLAYCONFIG_SDR_WHITE_LEVEL’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(461): error C2146: syntax error : missing ‘;’ before identifier ‘white_level’
1>…..\src\video\windows\SDL_windowsmodes.c(461): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(463): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(464): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(464): error C2224: left of ‘.header’ must have struct/union type
1>…..\src\video\windows\SDL_windowsmodes.c(465): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(465): error C2224: left of ‘.header’ must have struct/union type
1>…..\src\video\windows\SDL_windowsmodes.c(466): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(466): error C2224: left of ‘.header’ must have struct/union type
1>…..\src\video\windows\SDL_windowsmodes.c(467): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(467): error C2224: left of ‘.header’ must have struct/union type
1>…..\src\video\windows\SDL_windowsmodes.c(468): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(468): error C2224: left of ‘.header’ must have struct/union type
1>…..\src\video\windows\SDL_windowsmodes.c(469): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(469): error C2224: left of ‘.SDRWhiteLevel’ must have struct/union type
1>…..\src\video\windows\SDL_windowsmodes.c(470): error C2065: ‘white_level’ : undeclared identifier
1>…..\src\video\windows\SDL_windowsmodes.c(470): error C2224: left of ‘.SDRWhiteLevel’ must have struct/union type
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any idea how I can solve this without having to use a higher version of VisualStudio as this won’t build the proper SDL3?

Edit include/build_config/SDL_build_config_windows.h and comment out the line:
#define SDL_CAMERA_DRIVER_MEDIAFOUNDATION 1

1 Like

Thank you, It’s so hurtful that there’s no documentation on that topic, I ended up going through the code for hours… I can swear I haven’t seen this tip neither in the code nor on the internet. Can the “common information”, tips and tricks or something be collected somewhere for newcomers to ease up? I’m down to help as long as it’d reduce the amount of people going through it.

Keep in mind that SDL3 isn’t even released yet, so it’s not unexpected that it still has bugs, esp on an old operating system that’s not supported by its vendor anymore since 10 years (TBH I’m surprised SDL3 even still supports it)