Skip to content

SparCraft Windows Standalone Compilation

David Churchill edited this page Apr 17, 2016 · 4 revisions

It is quite easy to use SparCraft as library for creating standalone Windows executables.

Headers

To use SparCraft, you must include its headers. Make sure your project includes the SparCraft/source directory, and from within your program use the following:

#include "SparCraft.h"

Compiling - Prerequisites

To compile SparCraft as a standalone Windows exe, you must have the following:

  • Visual Studio 2013 (or any with v120 toolset)
  • BWAPI 4.12
  • SDL2 / SDL2_image (if you want to use the OpenGL GUI)

SparCraft uses the BWAPI library to obtain StarCraft data, and as such you must compile / link it with BWAPI 4.12 headers and binaries.

Compiling - Step By Step Instructions

To build SparCraft.lib:

  1. Install Visual Studio 2013 (or newer)
  2. Set BWAPI_DIR environment variable to your BWAPI folder
  3. Launch Visual Studio 2013
  4. Open SparCraft/VisualStudio/SparCraft.sln
  5. Build SparCraft project (creates SparCraft.lib)

To build and run the main SparCraft.exe:

  1. Build SparCraft_main (creates SparCraft.exe)
  2. Run SparCraft/VisualStudio/Release/SparCraft.exe CONFIGFILE from a terminal