Skip to content

Developer Getting Started: MinGW

Cong edited this page Jan 30, 2014 · 9 revisions

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

These instructions install SDL libraries into MinGW, but unfortunately CMake's Windows SDL support is quite poor, so these instructions are also designed to support CMake as well. Please make sure these instructions are followed correctly and in order!

  1. From the contents of the SDL-1.2.XX package, copy the contents of bin to C:\MinGW\bin, include into C:\MinGW\include, and lib into C:\MinGW\lib (so you should have the files C:\MinGW\bin\sdl-config, C:\MinGW\include\SDL\SDL.h, C:\MinGW\lib\libSDL.dll.a etc.)

  2. Do the same for SDL_mixer and SDL_image, combining the contents of the include and lib folders. However, you should also copy the DLLs e.g. SDL_mixer.dll to C:\MinGW for CMake's benefit.

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

  4. Create an environment variable SDLDIR that points to C:\MinGW

Run CMake

CMake MinGW support is buggy; make sure to follow these instructions carefully!

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

  2. Click "Configure", choosing MinGW Makefiles; click Finish.

  3. Open MinGW shell and navigate to /c/cdogs-sdl. Run ./make.sh and C-Dogs SDL should configure and build.

  4. If the last step didn't work (perhaps the wrong order was followed), open CMake Windows and select File > Delete Cache, and start this section over.

  5. Run cdogs-sdl. You are ready to go!