Skip to content

Developer Getting Started: Visual Studio

Cong edited this page Dec 13, 2018 · 35 revisions

Warning: using these instructions will not create a binary that is compatible with Windows XP! For releases, please follow the MinGW instructions.

Please note that Visual Studio 2013 is required! C-Dogs SDL is C99, which is unsupported by older Visual Studios.

For pre-2017 Visual Studios, see Visual Studio Setup.

Prerequisites

Clone repo: GitHub for Windows

Instructions for TortoiseGit are also available; these are not recommended

  1. Optional: for the purposes of this walkthrough, the clone location is C:\cdogs-sdl. To make GitHub for Windows automatically clone to this location, set the default storage directory to C:\.

  2. Click the "Clone in Windows" button in the repo website.

  3. You should now see the repo contents in C:\cdogs-sdl

Install SDL development libraries

  1. Choose a location for the SDL libraries (e.g. C:\dev).

  2. Copy the contents of the SDL2_2.0.XX subfolder to C:\dev (so you should have the folders C:\dev\include, C:\dev\lib etc.)

  3. Do the same for the other SDL2 libraries (e.g. SDL2_mixer), combining the contents of the include and lib folders.

  4. In C:\dev\lib, there are x86 and x64 versions of the same libraries. Copy the .lib files in x86 to the lib folder.

  5. Copy the .dll files to the C:\cdogs-sdl\src folder

  6. Create an environment variable SDLDIR that points to C:\dev

Visual Studio

  1. Open C:\cdogs-sdl

  2. Set the cdogs-sdl project as the startup project

  3. Press F5 to compile and run. You are ready to go!