And this command (I manually specify the include and lib folders in the command below) : clang main.c -std=c11 -I.\include\SDL2\ -L.\lib -lSDL2main -lSDL2 -o test.exe
But I get :
LINK : fatal error LNK1181: can't open entry file 'SDL2main.lib'
clang: error: linker command failed with exit code 1181 (use -v to see invocation)
I think it means that int main(int argc, char** argv) or int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd) is missing - but that should be provided by SDL2main…
Which one the linker expects depends on whether it thinks it’s building for the “console” or “windows” subsystem; I assume that SDL2main (esp. for VC) provides WinMain, so you’ll have to figure out how to tell clang that, with VC it’s like this: https://docs.microsoft.com/en-us/cpp/build/reference/entry-entry-point-symbol