I'm trying to build a simple SDL project in codeblocks using the VC compiler, and (obviously) having difficulty.
I'm using the VC6 SDL binaries from libsdl.org.
I've got the paths all set up correctly, no problems there.
I've set the "Multi-threaded DLL runtime library" flag in the project build options.
I have a single source file, main.cpp, with the following code:
#/* -- Include the precompiled libraries -- */
#ifdef WIN32
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")
#endif
#include "SDL.h"
int main(int argc, char **argv)
{
printf("\nHello SDL User!\n");
/* initialize SDL */
if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
{
fprintf( stderr, "Video initialization failed: %s\n",
SDL_GetError( ) );
SDL_Quit( );
}
SDL_Quit( );
return 0;
}
When I try to build, it compiles fine, but returns the following link error:
LINK : fatal error LNK1561: entry point must be defined
I've googled this error, and apparently it usually happens when a main() function isn't defined. As you can see, I have one. Any ideas what I am missing?
PS: Please forgive my newb-ness, especially if I am missing something really obvious.