Public Group

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

This topic is 4707 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
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.

##### Share on other sites
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 );

##### Share on other sites
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;}

##### Share on other sites
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)

##### Share on other sites
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.

##### Share on other sites
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 );

##### Share on other sites
i'm pretty sure, but just to be safe i tried again and made sure i selected empty project, same problem though.

##### Share on other sites
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 );

1. 1
2. 2
3. 3
Rutin
19
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633657
• Total Posts
3013200
×