Preparing Visual C++ Express 2010 and SDL Library
Before I could start creating even the simplest of programs, VS2010 Express for C++ had to be configured to use SDL (Simple DirectMedia Layer). There are two methods of adding these libraries...

Adding Libraries to existing system structure
This is the first method and is not recommended by the seasoned developer, as it can be difficult locating all the files for updating in the future. However, this makes life for a beginner a lot easier as less configuration of the project is required...

  1. Download SDL 1.2 Development Libraries for Win32 (http://www.libsdl.org/release/SDL-devel-1.2.14-VC8.zip) to "C:\TEMP\SDL".
  2. In Windows Explorer copy all files in "C:\TEMP\SDL\include" to "C:\Program Files\Microsoft Visual Studio 10.0\VC\include".
  3. In Windows Explorer copy all files in "C:\TEMP\SDL\lib" to "C:\Program Files\Microsoft Visual Studio 10.0\VC\lib".
  4. In Windows Explorer copy all files in "C:\TEMP\SDL\dist" to "C:\Windows\System32" for 32 Bit users or for 64 Bit users "C:\Windows\SysWOW64".
  5. Start Microsoft Visual C++ Express 2010.
  6. Create a new Win32 Console Application project in "C:\svn_working_folder\Projects\Trunk" (as discussed in the last article, which can be loaded into the SVN Repository) and give it a name.
  7. In the Win32 Application Wizard, click Next.
  8. Select Console Application, Empty Project and Precompiled Header, click Finish.
  9. In Solution Explorer, right-click on Source Files and select Add --> New Item.
  10. Select C++ File (.cpp) and provide a name (i.e. main).
  11. In Solution Explorer, right-click on the Project name and select properties.
  12. Select Configuration Properties --> Linker --> Input.
  13. On Additional Dependencies click the drop down button and select <Edit...>.
  14. In the Additional Dependencies window add on separate lines SDL.lib and SDLmain.lib.
  15. Click <OK>.
  16. Click <OK>.
NOTE : For SDL a Win32 Console Application project is required, if an empty project is selected the following error is displayed during compilation "LINK : fatal error LNK1561: entry point must be defined".


Adding Libraries to Stand-Alone Directories.
This is the second method, which is preferred by the seasoned developer as the libraries can be quickly located and updated if necessary.  This method requires slightly more configuration per project.
  1. Download SDL 1.2 Development Libraries for Win32 (http://www.libsdl.org/release/SDL-devel-1.2.14-VC8.zip) to "C:\svn_working_folder\Projects\Libraries\SDL".
  2. Start Microsoft Visual C++ Express 2010.
  3. Create a new Win32 Console Application project in "C:\svn_working_folder\Projects\Trunk" (as discussed in the last article, which can be loaded into the SVN Repository) and give it a name.
  4. In the Win32 Application Wizard, click Next.
  5. Select Console Application, Empty Project and Precompiled Header, click Finish.
  6. In Solution Explorer, right-click on Source Files and select Add --> New Item.
  7. Select C++ File (.cpp) and provide a name (i.e. main).
  8. In Solution Explorer, right-click on the Project name and select properties.
  9. Select Configuration Properties --> VC++ Directories.
  10. On Include Directories click the drop down button and select <Edit...>.
  11. In the Include Directories window add "C:\svn_working_folder\Projects\Libraries\SDL\include\".
  12. Click <OK>.
  13. On Library Directories click the drop down button and select <Edit...>.
  14. In the Library Directories window add "C:\svn_working_folder\Projects\Libraries\SDL\lib\".
  15. Click <OK>.
  16. Select Configuration Properties --> Linker --> Input.
  17. On Additional Dependencies click the drop down button and select <Edit...>.
  18. In the Additional Dependencies window add on separate lines SDL.lib and SDLmain.lib.
  19. Click <OK>.
  20. Click <OK>.
  21. In Windows Explorer copy all files in "C:\svn_working_folder\Projects\Libraries\SDL\dist" to the project debug folder, these will be required to execute the code.
NOTE : For SDL a Win32 Console Application project is required, if an empty project is selected the following error is displayed during compilation "LINK : fatal error LNK1561: entry point must be defined".