Lazy Foo' Productions

Setting up SDL in Visual C++ 6.0

Last Updated 1/02/07
1) First thing you need to do is download SDL headers and binaries.
You will find them on the SDL website, specifically on this page.

Scroll Down to the Development Libraries section and download the Windows development library

Open the zip and there should be a folder inside of it.
Open the folder and it'll contain a bunch of subfolders.

2)Copy SDL.lib and SDLmain.lib from the lib subfolder in the archive to the Visual C++ lib folder. The Visual C++ lib folder should be at C:\Program Files\Microsoft Visual Studio\VC98\Lib.

3)Next go to the Visual C++ include folder and create a folder called "SDL".
The Visual C++ include folder should be at C:\Program Files\Microsoft Visual Studio\VC98\Include.

4)Then open the include subfolder in the archive and extract its contents to the folder you just made, which should be at C:\Program Files\Microsoft Visual Studio\VC98\Include\SDL.

5)Now extract SDL.dll from the archive (it should be inside the lib subfolder), and extract it to C:\WINDOWS\SYSTEM32. This is so whenever you make an SDL app, the program will be able to find SDL.dll even if SDL.dll is not in the same directory.

6)Now start up Visual C++ and start a new Win32 project.

7)Then set it to be empty so nothing is automatically generated.
Then click finish. A new dialog will appear asking you to confirm the empty project, so just click ok.

8)Next go to project settings.

9)Under the C/C++ tab, set "Category" to Code Generation. Then set "Use run-time library" to multithreaded dll.

10)Under the Link tab, paste:
SDL.lib SDLmain.lib
in the Object/Library modules after the long set of libraries.

11)Add source new source file to the project to test out everything.

12)Paste the following code into the new source file:
#include "SDL/SDL.h" int main( int argc, char* args[] ) { //Start SDL SDL_Init( SDL_INIT_EVERYTHING ); //Quit SDL SDL_Quit(); return 0; }
13)Now Compile. Save the new source file if necessary. If there are no errors, you're finished. Otherwise go back and make sure you didn't skip a step.
Also, In the archive you just downloaded there's a subfolder called "docs". It contains the SDL documentation.

I highly recommend that you extract them somewhere and keep it for reference.