Difference between revisions of "How to build VCMI (Windows/Visual Studio 2015)"

From VCMI Project Wiki
Jump to: navigation, search
m
Line 38: Line 38:
  
 
= Getting Libraries =
 
= Getting Libraries =
 +
This section will show ways to get up-to-date versions of libraries required to build VCMI.
 +
== Boost ==
 +
*header files with extra things can be obtained from main boost download: [http://www.boost.org/users/download/]
 +
*to avoid rebuilding boost from sources, you can download prebuilt windows binaries (lib files) as well. MSVC 14 binaries are for Visual Studio 2015.
 +
== SDL2 and sublibraries ==
 +
*you can get SDL2 from [http://libsdl.org/download-2.0.php] - download development libraries to get lib and header files

Revision as of 12:07, 3 February 2017

Prerequisites

  • Installed Heroes3 (can be bought for $10 at gog.com)
  • Optionally, you can have also WoG or ERA installed.
  • IDE:
    • Microsoft Visual Studio 2015 (Community Edition recommended - it is free for non-commercial use). Earlier versions are out of scope of this tutorial.
  • Git client:
    • Visual Studio 2015 has built-in Git support. It isn't complete, but having most important Git commands integrated in IDE is very convienent. Additional GitHub extension for Visual Studio [1] gives few more features that may be useful.
    • Alternatively, you can use another Git client with better Git support, for example Sourcetree [2]
  • Libraries used by VCMI - where to get them will be explained later in this tutorial
    • Boost
    • SDL2
    • SDL2_image
    • SDL2_mixer
    • SDL2_TTF
    • FFmpeg
    • zlib
    • QT 5 (only used to compile VCMI launcher, which does not have to be rebuilt to test another VCMI parts)

Preparing place

Initial directory structure

Create a directory for VCMI development, eg. C:\VCMI. It will be base directory for VCMI source code.

It is recommended to avoid non-ascii characters in the path to your VCMI development folder. The folder should not be write-protected by system. Good location:

  • C:\VCMI

Bad locations:

  • C:\Users\Michał\VCMI (non-ascii character)
  • C:\Program Files (x86)\VCMI (write protection)

Obtaining VCMI sources

Using Sourcetree (version 1.9.6.1)

  • Click "Clone / New" button in upper left part of the program
  • Make sure you are in first tab (Clone Repository). In "Source Path / URL:" type following link: https://github.com/vcmi/vcmi.git
  • Set "Destination Path" field to directory desired for VCMI development and press "Clone" button.


Now you have the local copy of the repository on the disk. It should appear in the Team Explorer under the "Local Git Repositories" section. Double click it and then select a solution to open.


Getting Libraries

This section will show ways to get up-to-date versions of libraries required to build VCMI.

Boost

  • header files with extra things can be obtained from main boost download: [3]
  • to avoid rebuilding boost from sources, you can download prebuilt windows binaries (lib files) as well. MSVC 14 binaries are for Visual Studio 2015.

SDL2 and sublibraries

  • you can get SDL2 from [4] - download development libraries to get lib and header files