Difference between revisions of "MG/Windows Compiling"

From MegaGlest
Jump to navigation Jump to search
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Windows Compiling:'''<br />
+
This page explains how to compile [[MegaGlest]] for Windows.
1. [[MG/Getting The Code|Get the project ]] from [[MG/SVN Structure|MegaGlests' subversion repository]] using the commandline or your favorite subversion utility (probably [http://tortoisesvn.tigris.org/ Tortoise]). If you are going to use subversion on 64-bit Windows 7 and get error messages like ''The file or directory is corrupted and unreadable'' then that's because your OS's only primary file system [http://glest.org/glest_board/?topic=5611.msg58480#msg58480 is buggy].<br />
 
2. Download the [https://sourceforge.net/projects/megaglest/files/win32_deps.7z/download build dependencies archive].<br />
 
3. Decompress (using [http://www.7-zip.org/ 7-zip]) the dependency archive into the source folder. You should now see a '''win32_deps''' sub-folder with lots of stuff inside.<br />
 
4. Open the main solution in Visual Studio (use '''[http://www.microsoft.com/express/downloads/#2008-Visual-CPP VC++ 2008 Express]''', currently '''2010 does not work''') located in:''' mk/windoze/Glest.sln'''<br />
 
5. Do a rebuild project.<br />
 
6. If nothing goes wrong you will see '''glest_game.exe''' (and other binaries) in '''data/glest_game''' (where all the data content lives).<br />
 
7. To test the game, run the batch file '''CopyWindowsRuntimeDlls.bat''' located in '''mk\windoze''' to copy dependency dll's to the runtime binary folder
 
  
 +
==Compiling from source==
 +
#[[MG/Getting The Code|Get the project ]] from [[MG/SVN Structure|MegaGlest's subversion repository]] using the command line or your favorite subversion utility (such as [http://tortoisesvn.tigris.org/ TortoiseSVN]). If you are going to use subversion on 64-bit Windows 7 and get error messages like ''The file or directory is corrupted and unreadable'' then that's because your OS's only primary file system [http://glest.org/glest_board/?topic=5611.msg58480#msg58480 is buggy].
 +
#Download the [https://sourceforge.net/projects/megaglest/files/win32_deps.7z/download build dependencies archive].
 +
#Decompress (using [http://www.7-zip.org/ 7-zip]) the dependency archive into the folder named source. You should now see a <tt>win32_deps</tt> sub-folder with many files inside.
 +
#Open the main solution in [http://www.microsoft.com/express/downloads/#2008-Visual-CPP Visual Studio] (it is recommended that VC++ 2008 be used, 2010 project files are also included and 'may' work but are not the primary environment used by megaglest developers) located in <tt>mk/windoze/Glest.sln</tt>
 +
#Perform a rebuild project.
 +
#If nothing goes wrong you will see <tt>megaglest.exe</tt> (and other binaries) in <tt>data/glest_game</tt> (where all the data content lives).
 +
#To test the game, run the batch file <tt>CopyWindowsRuntimeDlls.bat</tt> located in <tt>mk\windoze</tt> to copy dependency dll's to the runtime binary folder.
  
 +
==Windows Compiling in a Batch==
 +
[[File:SS_of_MG_Windows_Batch_File.png|thumb|MegaGlest batch file.]]
 +
There is a convenient batch file (which assumes you have installed [http://www.sliksvn.com/en/download SlikSVN] for subversion command line use) which will:
  
'''Windows Compiling in a Batch:'''
+
#Update the branch you are working in with the latest subversion code
 
+
#Touch the game_util.cpp file with the latest date/time
There is a convenient batch file (which assumes you have installed [http://www.sliksvn.com/en/download SlikSVN] for subversion command line use) which will:
+
#Compile all projects from command line
  
#update the branch you are working in with the latest subversion code
+
This batch file exists within with <tt>mk\windoze</tt> folder and is called: <tt>build-mg.bat</tt>
#touch the game_util.cpp file with the latest date/time
 
#compile all projects from command line
 
  
This batch file exists within with mk\windoze folder and is called: '''build-mg.bat'''
+
==See also==
 +
*[[MegaGlest]]
 +
*[[MG/Linux Compiling|Linux Compiling]]
 +
*[[MG/Mac Compiling|Mac Compiling]]
 +
*[[MG/FreeBSD Compiling|FreeBSD Compiling]]
 
[[Category:MG]]
 
[[Category:MG]]
 +
[[Category:Compiling]]

Revision as of 19:45, 21 October 2011

This page explains how to compile MegaGlest for Windows.

Compiling from source

  1. Get the project from MegaGlest's subversion repository using the command line or your favorite subversion utility (such as TortoiseSVN). If you are going to use subversion on 64-bit Windows 7 and get error messages like The file or directory is corrupted and unreadable then that's because your OS's only primary file system is buggy.
  2. Download the build dependencies archive.
  3. Decompress (using 7-zip) the dependency archive into the folder named source. You should now see a win32_deps sub-folder with many files inside.
  4. Open the main solution in Visual Studio (it is recommended that VC++ 2008 be used, 2010 project files are also included and 'may' work but are not the primary environment used by megaglest developers) located in mk/windoze/Glest.sln
  5. Perform a rebuild project.
  6. If nothing goes wrong you will see megaglest.exe (and other binaries) in data/glest_game (where all the data content lives).
  7. To test the game, run the batch file CopyWindowsRuntimeDlls.bat located in mk\windoze to copy dependency dll's to the runtime binary folder.

Windows Compiling in a Batch

MegaGlest batch file.

There is a convenient batch file (which assumes you have installed SlikSVN for subversion command line use) which will:

  1. Update the branch you are working in with the latest subversion code
  2. Touch the game_util.cpp file with the latest date/time
  3. Compile all projects from command line

This batch file exists within with mk\windoze folder and is called: build-mg.bat

See also