Getting and Installing SDL

The SDL package can be put on your home computer:

To avoid setting some Project Properties for every new SDL project in Visual Studio, follow these steps:
  1. Make a directory under C:\Program Files\Microsoft Visual Studio 9.0\VC\include called SDL
  2. Transfer all of the .h files from the SDL-1.2.14\include directory into this newly created SDL directory.
  3. Copy SDL-1.2.14\lib\SDL.dll to C:\WINDOWS\System
  4. Copy SDLmain.lib and SDL.lib (also in SDL-1.2.14\lib\) to C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
If you want to use SDL on a computer where you are not an admin and it is not already installed:
  1. Make a directory in your project folder called SDL.
  2. Transfer all of the .h files from the SDL-1.2.14\include\ directory into this newly created SDL directory.
  3. Copy SDL-1.2.14\lib\SDL.dll to you project folder
  4. Make a directory in your project folder called lib.
  5. Copy SDLmain.lib and SDL.lib (also in SDL-1.2.14\lib\) into that lib folder.

Setting up a SDL project with Visual Studio

If you installed SDL by following the above directions:

  1. In Visual Studio, create a new project.



  2. Under "Visual C++ Projects", select 'Win32 Project' under the 'Win32' folder. Choose a 'Name' and 'Location'



  3. At the Application Wizard. Click on the 'Application Settings', select 'Empty project'



  4. Click on 'Finish'.
     
  5. Save the 'main.cpp' code into the project directory
    For new projects, you can start from this SDL template.
     
  6. Right-click on the "Source Files" in the solution tree, and select 'Add Existing Item...'



  7. Select 'main.cpp', and click 'Open'.
     
  8. We can now make some changes to the properties. Under the 'Project' Menu, select 'Properties'.



  9. Under the 'Linker' folder in the 'Input' category, add "SDLmain.lib sdl.lib opengl32.lib glu32.lib" (without quotes) in the "Additional Dependencies" field.



  10. If you added SDL to your project folder rather than the system wide location:
  11. Click 'OK' to accept the changes