can i get a full walkthrough of how to setup SDL for VS express?

Started by
12 comments, last by Mushu 18 years, 2 months ago
i need to set up SDL with VS2005 C++ Express edition, i've tried a couple times to set it up and each time it didn't work. can somebody walk me through it?
Advertisement
best thing to do is to download Code::Blocks its got templates for sdl and everything.. its the perfect compiler... i have vc 2005 and i prefer codeblocks over it... if you go get that i can step you through that.
What does "it didn't work" mean? Did you get a compiler error? If so, please post a few of them here. Were files you needed missing (like .h files)? Did it compile but nothing show up on the screen? Compile and then crash?



~BenDilts( void );
k, i downloaded code::blocks and installed it
when i try to compile it in VS i get

"fatal error LNK1561: entry point must be defined"
i have SDL.h in my header files

/* -- Include the precompiled libraries -- */#include <iostream>using namespace std;#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");	cout << "hi sdl user";	/* initialize SDL */	if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )	{		fprintf( stderr, "Video initialization failed: %s\n",			SDL_GetError( ) );		SDL_Quit( );	}		SDL_Quit( );	return 0;}
http://www.aaroncox.net/tutorials/ is what I used to set it up (its for 2k3, bit im pretty sure the proccess is the same for 2k5)
-Matt S.
everything is correct on there, i have the library and include files added to the VC++ Directories in the options menu. i have Multi-Threded DLL selected in Code Generation, sdl.lib and sdlmain.lib listed in the additional dependencies. i have the DLL in my project folder too.
MSDN on your error. Basically, it means that the linker couldn't find your main() function. So maybe you created a Windows Forms project or a DLL project or LIB project by accident?



~BenDilts( void );
i'm pretty sure, but just to be safe i tried again and made sure i selected empty project, same problem though.
Try putting in
#define WIN32
at the top of your file. Perhaps, since you created an empty project, that preprocessor definition never got put in and thus you aren't linking with SDLmain.lib, causing your linking error.



~BenDilts( void );

This topic is closed to new replies.

Advertisement