You must also
#pragma comment(lib, "SDLmain.lib")
Make sure that you have set these settings in your project:
Also: my non-compilable example code above uses SDL_image but SDL_image is not part of the standalone SDL, it is an additional header file that allows some greater flexibility requiring image file types, etc. . So -- sorry to have gotten you confused, at the time of writing I supposed that it was apparent that the code was portraying structure and was not readily compilable.
If your project is set up properly and your additional dependencies and other settings are correct, this should compile fine:
int main( int argc, char* args )
SDL_Init( SDL_INIT_EVERYTHING );
If this doesn't compile, there's something left to be added in your project settings.
Try it out.
SDL requires SDL.lib and SDLmain.lib to be added in Project Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies (or requires using the
commands for "SDL.lib" and "SDLmain.lib").
Furthermore, make sure that SDL's include directory is added in:
Project Properties -> Configuration Properties -> VC++ Directories -> Include Directories
and also add SDL's lib directory in Project Properties -> Configuration Properties -> VC++ Directories -> Library Directories. Steps 3-8 in the tutorial I linked for setting up SDL in Visual Studio describe this process.