FANDOM


Those informations are/may be very outdated, please go to: new wiki

This page explains how to compile MegaGlest for Windows.

Two approachesEdit

Generally, there are two approaches to get your work done:

  • CLI: the automatable and fast one, using command line utilities and batch files
  • GUI: the slow and shiny one, using graphical user interfaces

The MegaGlest developers prefer the first approach, and this is also the most tested and recommended approach. You can also choose the GUI approach, which should work, but please do not expect us to support you with setting up your VC++ build environment or GUI GIT client since this is hard to support and eats a lot of time. So if you choose this approach, please do not ask for support unless you do know how this is done properly and that the issues you are running into are clearly due to a bug in the solution files or this documentation.

PrepareEdit

The CLI approachEdit

  • Install GIT CLI. Important: On install-options choose "Run Git from Windows Command Prompt".
  • Use Git to check out the MegaGlest source code and game data into your local GIT working copy.
  • Ensure that the 7-zip command is available globally (add it to your PATH). If the installer did not automatically add the installation directory to the system path, instructions are available here).
  • Locate and run the batch file:
    SS of MG Windows Batch File

    MegaGlest batch file

    mk\windoze\build-mg-2010.bat (Note: that it may be necessary to run this as an administrator, then right click on it and choose "run as administrator"), which performs/ automates the following steps (listed on below list) for you:
    • Download and extract the build dependencies archive to source\windows_deps\ directory unless you already have it
      • On the first run, also run the mk\windoze\CopyWindowsRuntimeDlls_2010.bat batch file to copy runtime dependency DLL's to the runtime binary folder.
    • Update the branch you are working in with the latest GIT code
    • Update the timestamp and revision number on source\glest_game\facilities\game_util.cpp
    • Compile all projects from command line
  • If nothing goes wrong you will see megaglest.exe (and other binaries) in mk\windoze\

The GUI approachEdit

  • Read the above Two approaches paragraph since it provides important information on the limits of this aproach.
  • Install TortoiseGIT or a similar GIT client and use it to check out the MegaGlest source code and game data into your local GIT working copy.
  • Download the build dependencies archive.
  • Decompress the 7-zip compressed build dependencies archive into the source subdirectory of your GIT working copy. You should then see a source\windows_deps\ directory with many files inside.
    • On the first run, also run the mk\windoze\CopyWindowsRuntimeDlls_2010.bat batch file to copy runtime dependency DLL's to the runtime binary folder.
  • Start Visual C++ 2010 and open the main solution, located in mk\windoze\Glest_vc2010.sln
  • Perform a rebuild project.
  • If nothing goes wrong you will see megaglest.exe (and other binaries) in mk\windoze

Trouble shootingEdit

BuildingEdit

If your build fails, and you have not been building for a while, this is usually due to outdated build dependencies. Check http://sourceforge.net/projects/megaglest/files/ for when  windows_deps.7z was last updated, and if it's more recent than the one you have in source\ (or if you are unsure), then recursively delete both source\windows_deps\ and source\windows_deps.7z. Deleting files recursively on Windows GUI can take ages, so to quickly delete recursively, do it on your command line after changing to the correct directory: rd /Q /S source\windows_deps\ and del /Q source\windows_deps.7z. When using the GUI approach, you also need to manually download the updated build dependencies archive and extract it into the source\ directory in your GIT repository. With the CLI approach, this will be done automatically on next build.

RunningEdit

If MegaGlest crashes you should do a full rebuild. To do so with the CLI approach, instead of just running mk\windoze\build-mg-2010.bat, run mk\windoze\build-mg-2010.bat n rebuild to trigger a full rebuild.

If you run into dependency errors when starting the game, be sure to re-run the mk\windoze\CopyWindowsRuntimeDlls_2010.bat batch file to copy possibly updated runtime dependency DLL's to the runtime binary folder.

Reporting bugsEdit

If you think you have run into a bug in MegaGlest, and neither reading the README and FAQ nor searching for it at http://bugs.megaglest.org helps, then please report a new bug at http://bugs.megaglest.org/ (one-time registration is neccessary to post).

When filing a bug, please provide a log of the build process of a full rebuild. With the CLI approach, run the build batch file and redirect all output to a log file, such as by using:

cd mk\windoze\
build-mg-2010.bat n rebuild 1>%Temp%\build-mg-2010.log 2>&1
@echo The build log was written to: %Temp%\build-mg-2010.log

The GUI approach will always do a full rebuild if you do it as described above.

See alsoEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.