Difference between revisions of "MG/CodeBlocks Compiling"

From MegaGlest
Jump to navigation Jump to search
 
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=='''CodeBlocks Cross Platform IDE / Compiling'''==
+
'''This method of building MegaGlest is no longer officially supported.''' This page details how to perform cross platform compiling for MegaGlest with CodeBlocks. It is recommended to use VC++ instead of this approach if compiling on Windows. Project files for codeblocks are not always up to date and therefore not fully supported but rather for educational purposes. The cmake build system used by megaglest may produce codeblocks project files that work better than the project files included in these steps.
Please note that we do not currently recommend this approach on Windows unless you know how to fix compilation and linking issues by yourself. On Windows, use VC++ 2008 for now.
 
===Choose a subversion client===
 
  
====Linux====
+
==CodeBlocks Cross Platform IDE / Compiling==
 
 
Most users will want to use the [https://subversion.apache.org/ Apache Software Foundation (ASF) subversion] command line interface (CLI), as provided, on most distributions, by the 'subversion' package. Many distributions also provide graphical interfaces which are either frontends to the ASF subversion CLI or are standalone.
 
 
 
====Windows====
 
 
 
If you fancy graphical interfaces then [http://tortoisesvn.tigris.org/ Tortoise] is for you. If you actually like to work on a command line interfaces, then [http://www.sliksvn.com/en/download/ SlikSVN] is the utility you want.
 
 
 
Windows 7 note: 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].
 
 
===Check out the source code===
 
===Check out the source code===
  
[[MG/Getting The Code|Get the project from]] [[MG/SVN Structure|MegaGlests' subversion repository]].
+
Pick a subversion client, then [[MG/Getting The Code|get the project]] from [[MG/SVN Structure|MegaGlests' subversion repository]].
  
 
===Get the dependencies===
 
===Get the dependencies===
Line 20: Line 10:
 
Ensure you have the following library dependencies:
 
Ensure you have the following library dependencies:
  
''jpeg, lua5.1, png, SDL, openal, curl, xerces-c, ogg, vorbis, vorbisfile, vorbisenc, z, GL, GLU, SDLmain, ircclient (and the tools require wx)<br />''
+
''jpeg, lua5.1, png, SDL, openal, curl, xerces-c, ogg, vorbis, vorbisfile, vorbisenc, z, GL, GLU, SDLmain, ircclient''
  
 +
Some of the tools also require ''wx''. On Debian like systems (such as Ubuntu and its derivatives), these packages will typically start with "lib", sometimes have a number added, and end with "-dev". For example, the development package for the xerces-c library may be called ''libxerces-c2-dev''.
  
Hint: On Debian like systems (such as Ubuntu and its derivatives), these packages will typically start with "lib", sometimes have a number added, and end with "-dev". For example, the development packagefor the xerces-c library may be called ''libxerces-c2-dev''.
 
 
====Windows====
 
====Windows====
Download the [https://sourceforge.net/projects/megaglest/files/win32_deps_mingw.7z/download mingw build dependencies archive], then decompress (using [http://www.7-zip.org/ 7-zip]) the mingw dependency archive into the '''source''' folder. You should now see a '''source\win32_deps''' sub-folder with lots of stuff inside.
+
Download the [https://sourceforge.net/projects/megaglest/files/win32_deps_mingw.7z/download Mingw build dependencies archive], then decompress the mingw dependency archive (using [http://www.7-zip.org/ 7-zip]) into the ''source'' folder. You should now see a ''source\win32_deps'' sub-folder with lots of stuff inside.
  
 
===Install CodeBlocks===
 
===Install CodeBlocks===
 
 
[http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks Install CodeBlocks] for your platform.
 
[http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks Install CodeBlocks] for your platform.
  
  
 
===Configure CodeBlocks===
 
===Configure CodeBlocks===
 
+
If you plan to build Windows binaries ([http://forums.codeblocks.org/index.php?topic=3343.0 Linux Cross Compile] or [http://wiki.codeblocks.org/index.php?title=MinGW_installation Windows Mingw]) configure CodeBlocks for Mingw.
If you plan to build Windows binaries ([http://forums.codeblocks.org/index.php?topic=3343.0 Linux Cross Compile] or [http://wiki.codeblocks.org/index.php?title=MinGW_installation Windows Mingw]) configure CodeBlocks for mingw.
 
  
 
Open the main workspace in CodeBlocks located in:''' mk/windoze/megaglest.workspace'''
 
Open the main workspace in CodeBlocks located in:''' mk/windoze/megaglest.workspace'''
  
 
===Make a build===
 
===Make a build===
 
 
Select the build target (the dropdown at the top) from current available options:
 
Select the build target (the dropdown at the top) from current available options:
  
Line 50: Line 37:
 
*Debug Linux.
 
*Debug Linux.
  
From the Build Menu option Select '''Rebuild Workspace'''.<br />
+
From the Build Menu option Select ''Rebuild Workspace''.
  
 
===Inspecting your builds===
 
===Inspecting your builds===
 
 
====Linux targets====
 
====Linux targets====
 
+
Linux targets compile into ''mk/linux'' and are called ''glest.bin, glest_editor, glest_g3dviewer'' etc.
Linux targets compile into '''mk/linux''' and are called '''glest.bin, glest_editor, glest_g3dviewer''' etc.
 
  
 
====Windows targets====
 
====Windows targets====
 +
If nothing goes wrong you will see ''glest_game.exe'' (and other binaries) in ''data/glest_game'' for Windows targets (where all the data content lives).
  
If nothing goes wrong you will see '''glest_game.exe''' (and other binaries) in '''data/glest_game''' for Windows targets (where all the data content lives).
+
To test the game, Windows users copy dependency DLL's from the ''win32_deps\lib'' folder to the runtime binary folder.
 
+
[[Category: MG]]
To test the game, Windows users copy dependency dll's from the '''win32_deps\lib''' folder to the runtime binary folder.
 

Latest revision as of 17:47, 19 December 2012

This method of building MegaGlest is no longer officially supported. This page details how to perform cross platform compiling for MegaGlest with CodeBlocks. It is recommended to use VC++ instead of this approach if compiling on Windows. Project files for codeblocks are not always up to date and therefore not fully supported but rather for educational purposes. The cmake build system used by megaglest may produce codeblocks project files that work better than the project files included in these steps.

CodeBlocks Cross Platform IDE / Compiling[edit]

Check out the source code[edit]

Pick a subversion client, then get the project from MegaGlests' subversion repository.

Get the dependencies[edit]

Linux[edit]

Ensure you have the following library dependencies:

jpeg, lua5.1, png, SDL, openal, curl, xerces-c, ogg, vorbis, vorbisfile, vorbisenc, z, GL, GLU, SDLmain, ircclient

Some of the tools also require wx. On Debian like systems (such as Ubuntu and its derivatives), these packages will typically start with "lib", sometimes have a number added, and end with "-dev". For example, the development package for the xerces-c library may be called libxerces-c2-dev.

Windows[edit]

Download the Mingw build dependencies archive, then decompress the mingw dependency archive (using 7-zip) into the source folder. You should now see a source\win32_deps sub-folder with lots of stuff inside.

Install CodeBlocks[edit]

Install CodeBlocks for your platform.


Configure CodeBlocks[edit]

If you plan to build Windows binaries (Linux Cross Compile or Windows Mingw) configure CodeBlocks for Mingw.

Open the main workspace in CodeBlocks located in: mk/windoze/megaglest.workspace

Make a build[edit]

Select the build target (the dropdown at the top) from current available options:

  • Release Win32
  • Release Linux
  • Debug Win32
  • Debug Linux.

From the Build Menu option Select Rebuild Workspace.

Inspecting your builds[edit]

Linux targets[edit]

Linux targets compile into mk/linux and are called glest.bin, glest_editor, glest_g3dviewer etc.

Windows targets[edit]

If nothing goes wrong you will see glest_game.exe (and other binaries) in data/glest_game for Windows targets (where all the data content lives).

To test the game, Windows users copy dependency DLL's from the win32_deps\lib folder to the runtime binary folder.