Skip to content

Developer Getting Started: Visual Studio

Cong edited this page Jul 24, 2014 · 35 revisions

Warning: using these instructions will not create a binary that is compatible with Windows XP! For releases, please follow the [MinGW](./Developer Getting Started: MinGW) instructions.

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

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 SDL_1.2.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 SDL libraries (e.g. SDL_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

Run CMake

  1. Run CMake: for "Where is the source code:" and "Where to build the binaries:" input C:\cdogs-sdl

  2. Click "Configure", choosing the right Visual Studio version (e.g. VS2012 is VS11); click Finish

  3. Click "Generate"; you should now see Visual Studio projects in C:\cdogs-sdl.

Visual Studio

  1. Open C:\cdogs-sdl\cdogs-sdl.sln

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

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