MG/CodeBlocks Compiling

From MegaGlest
Jump to navigation Jump to search

CodeBlocks Cross Platform IDE / Compiling

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

Most users will want to use the 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 Tortoise is for you. If you actually like to work on a command line interfaces, then 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 is buggy.

Check out the source code

Get the project from MegaGlests' subversion repository.

Get the dependencies

Linux

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)


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

Download the mingw build dependencies archive, then decompress (using 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.

Install CodeBlocks

Install CodeBlocks for your platform.


Configure CodeBlocks

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

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

Linux targets

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

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).

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