Difference between revisions of "Compile In Windows"

From FreeOrionWiki
Jump to: navigation, search
m (Step by Step: clarification to bootstrap step)
(We use msvc2015, not msvc2013)
 
(8 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
===Compiler===
 
===Compiler===
  
FreeOrion can be compiled on Windows with Visual Studio 2010 or Visual Studio 2013.  Premade Visual Studio project files are available in the source code repository for each of these versions of Visual Studio, and the SDK provides precompiled dependencies for the compiler.  Project files may also be generated using CMake.
+
FreeOrion can be compiled on Windows with Visual Studio 2015 Update 3.  Premade Visual Studio project files are available in the source code repository, and the SDK provides precompiled dependencies for the compiler.  Project files may also be generated using CMake.
  
 
====Getting Visual Studio====
 
====Getting Visual Studio====
  
=====Visual Studio 2010=====
+
Visual Studio Community and Express can be [https://www.visualstudio.com/downloads/download-visual-studio-vs#DownloadFamilies_2 downloaded from Microsoft here].  If you're not sure which edition to pick, take the latest one for Windows Desktop.  You will need a Microsoft account to proceed, if you don't have one, you will have to register one.
 
+
Visual Studio 2010 Express Edition may be [https://www.visualstudio.com/downloads/download-visual-studio-vs#DownloadFamilies_4 downloaded for trial] from Microsoft.  But after 30 days you have to register for free.
+
 
+
If you are a student, you may also be eligible for [http://www.dreamspark.com Microsoft Dreamspark], which will give you the Professional version of MSVC 2010 or several other Microsoft programs.
+
 
+
Also, if you are a student you should check out if your university takes part in the MSDNAA (Microsoft Developers Network Academic Alliance).  You might be able to get Visual Studio 2010 Ultimate and other very pricy software for free or at some places for a small administrative fee (like 5€ to get access for a semester).
+
 
+
=====Visual Studio 2013=====
+
 
+
Visual Studio Express 2013 can be [https://www.visualstudio.com/downloads/download-visual-studio-vs#DownloadFamilies_2 downloaded from Microsoft here].  If you're not sure which edition to pick, take the one for Windows Desktop.  You will need a Microsoft account to proceed, if you don't have one, you will have to register one.
+
 
+
If you want to avoid registering a Microsoft account, try to download Microsoft Visual Studio Express 2013 for Windows Desktop with Update 4 via [https://www.microsoft.com/en-US/download/details.aspx?id=44914 this link].
+
  
 
===Version Control System===
 
===Version Control System===
  
The FreeOrion project uses [http://en.wikipedia.org/wiki/Git_%28software%29 Git] for version control. To be able to use the SDK, you need to install the git command line client (the most recent release for Windows can be downloaded [http://git-scm.com/download/win here]). '''Important:''' When installing the git command line client, be sure to select the option that will include the git executable in your command path, otherwise the batch script which sets up the SDK will fail.
+
The FreeOrion project uses [[wikipedia:Git_(software)|Git]] for version control. To be able to use the SDK, you need to install the git command line client (the most recent release for Windows can be downloaded [http://git-scm.com/download/win here]). '''Important:''' When installing the git command line client, be sure to select the option that will include the git executable in your command path, otherwise the batch script which sets up the SDK will fail.
  
 
==Compilation Instructions==
 
==Compilation Instructions==
Line 29: Line 17:
 
===Step by Step===
 
===Step by Step===
  
# First, get the [http://sourceforge.net/projects/freeorion/files/FreeOrion%20SDK FreeOrion SDK] for Windows from SourceForge. (~30MB)
+
# First, get the FreeOrion SDK for Windows from [https://github.com/freeorion/freeorion-sdk/releases GitHub] (for FreeOrion later than v0.4.6) or [http://sourceforge.net/projects/freeorion/files/FreeOrion%20SDK SourceForge] (for FreeOrion v0.4.6 and earlier). (~50 or 35 MB)
 
# Unpack the SDK to a directory of your choice.
 
# Unpack the SDK to a directory of your choice.
 
# Run the ''bootstrap.bat'' file located in the root folder of the unpacked SDK. This will (among other things) download and check out the source code from GitHub ([https://github.com/freeorion/freeorion freeorion/freeorion] repository, checked out branch will be "master").
 
# Run the ''bootstrap.bat'' file located in the root folder of the unpacked SDK. This will (among other things) download and check out the source code from GitHub ([https://github.com/freeorion/freeorion freeorion/freeorion] repository, checked out branch will be "master").
# Depending on which version of Visual Studio you're using, open FreeOrion\msvc2010\FreeOrion.sln or FreeOrion\msvc2013\FreeOrion.sln
+
# Depending on which version of Visual Studio you're using, open FreeOrion\msvc2015\FreeOrion.sln
 
# Use Build->Build Solution to build all projects' release targets.
 
# Use Build->Build Solution to build all projects' release targets.
  
Line 39: Line 27:
 
===Software Dependencies===
 
===Software Dependencies===
  
The majority of FreeOrion dependencies can be found precompiled and packaged in the FreeOrion Windows SDK, from the [http://sourceforge.net/projects/freeorion/files/FreeOrion%20SDK/ SourceForge FreeOrion SDK page].
+
The SDK includes compiled libraries, headers and DLLs for: zlib, Python 2, Boost, FreeType, GLEW, libpng, OpenAL, libvorbis, and libogg, SDL2.
 
+
The SDK includes compiled libraries, headers and DLLs for: zlib, Python, Boost, FreeType, GLEW, libpng, libjpeg, OpenAL, ALUT, libvorbis, and libogg, SDL2.
+
  
 
==Runtime Errors==
 
==Runtime Errors==
  
 
Please report runtime errors in the [http://www.freeorion.org/forum/viewtopic.php?f=9&t=1787 forums].
 
Please report runtime errors in the [http://www.freeorion.org/forum/viewtopic.php?f=9&t=1787 forums].

Latest revision as of 13:06, 25 March 2018

Prerequisites

Compiler

FreeOrion can be compiled on Windows with Visual Studio 2015 Update 3. Premade Visual Studio project files are available in the source code repository, and the SDK provides precompiled dependencies for the compiler. Project files may also be generated using CMake.

Getting Visual Studio

Visual Studio Community and Express can be downloaded from Microsoft here. If you're not sure which edition to pick, take the latest one for Windows Desktop. You will need a Microsoft account to proceed, if you don't have one, you will have to register one.

Version Control System

The FreeOrion project uses Git for version control. To be able to use the SDK, you need to install the git command line client (the most recent release for Windows can be downloaded here). Important: When installing the git command line client, be sure to select the option that will include the git executable in your command path, otherwise the batch script which sets up the SDK will fail.

Compilation Instructions

Step by Step

  1. First, get the FreeOrion SDK for Windows from GitHub (for FreeOrion later than v0.4.6) or SourceForge (for FreeOrion v0.4.6 and earlier). (~50 or 35 MB)
  2. Unpack the SDK to a directory of your choice.
  3. Run the bootstrap.bat file located in the root folder of the unpacked SDK. This will (among other things) download and check out the source code from GitHub (freeorion/freeorion repository, checked out branch will be "master").
  4. Depending on which version of Visual Studio you're using, open FreeOrion\msvc2015\FreeOrion.sln
  5. Use Build->Build Solution to build all projects' release targets.

Compilation may take some time: ~1 hour on Core i3 370M with 6GB RAM, ~20 min on Core i7 4710HQ with 8 GB RAM.

Software Dependencies

The SDK includes compiled libraries, headers and DLLs for: zlib, Python 2, Boost, FreeType, GLEW, libpng, OpenAL, libvorbis, and libogg, SDL2.

Runtime Errors

Please report runtime errors in the forums.