Difference between revisions of "Compiling using Code::Blocks"

From OdaWiki
(Step 2: Getting MinGW)
 
(26 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<b>Overview:</b>
 
---------
 
 
The ODAMEX Source package comes with a variety of project and workspace files.
 
The ODAMEX Source package comes with a variety of project and workspace files.
  
Line 7: Line 5:
 
==Step 1: Getting Code::Blocks==
 
==Step 1: Getting Code::Blocks==
  
You can download Code::Blocks from its website here: [http://www.codeblocks.org/ Code::Blocks]. Be sure to get the '''latest nightly build'', and not Release Canadate 2 as this is the one that works with the current project files.
+
You can download Code::Blocks from its website here: [http://www.codeblocks.org/ Code::Blocks]. '''Be sure to get the latest release installer WITH MinGW'''
  
==Step 2: Getting MinGW==
+
==Step 2: Setting up the compiler==
  
This step is only required if you are using the Code::Blocks nightly builds.  Once an official Code::Blocks package is released (rc3 or 1.0), MinGW will be included with Code::Blocks and you can skip this step.
+
=== Windows ===
 +
Download the installer and run it, but don't start Code::Blocks yet.
  
You need the latest version of MinGW from [http://www.mingw.org/download.shtml/ this website].  The all-in-one package is the one you want to install, called [http://prdownloads.sf.net/mingw/MinGW-3.1.0-1.exe?download MinGW-3.1.0-1.exe], but please check to see if a newer verison is avalable.  When installing, you might as well install it all, it's not that big.
+
===Linux===
 +
Chances are, your linux installation already has all the necessary programs. If not, refer to your individual distribution's installation methods for installing gcc, gnu make and their appropriate libraries.
  
If you are compiling Odamex for the purpose of debugging, grab GDB as well.
+
==Step 3: Required Libraries==
  
==Step 3: Required Libraries ==
+
Odamex requires the following libraries to compile:
  
For ODAMEX to successfully compile, you must obtain some libraries for it, which are:
+
* [http://www.libsdl.org/download-1.2.php SDL Development Library]
 +
* [http://www.libsdl.org/projects/SDL_mixer/ SDL_mixer Development Library]
  
=== SDL Development Libraries ===
+
===Windows===
You can get the latest version of SDL [http://www.libsdl.org/download-1.2.php  here]
+
Copy the '''include\SDL''' and '''lib''' folders from the archives and paste them into your '''path-to-codeblocks\MinGW''' directory, overwriting the old '''include''' and '''lib''' folders respectively.
  
Unzip the appropriate archive (SDL-devel-1.2.11-mingw32.tar.gz as the time of this writing) onto the desktop (don't worry, it comes in its own tidy little folder).  Copy the bin, include and lib folders from the archive and paste them into your C:\MinGW directory.
+
'''Note:''' You may need to copy the files from '''include\SDL''' to the '''include''' directory in the '''path-to-codeblocks\MinGW''', otherwise when it comes time to build the client, it will complain about SDL.h missing.
  
=== SDL_mixer Development Libraries ===
+
===Linux===
 
+
Refer to your individual distribution's installation methods for installing SDL and SDL_mixer libraries.
You can get the latest version of SDL_mixer [http://www.libsdl.org/projects/SDL_mixer/ here]
+
 
+
Unzip the appropriate archive (SDL_mixer-devel-1.2.7-VC6.zip as the time of this writing) into your MinGW directory.
+
  
 
==Step 4: Getting the source code for ODAMEX==
 
==Step 4: Getting the source code for ODAMEX==
  
This can be obtained through the [http://www.odamex.net website] or from the [[SVN]] repository  
+
The source code can be obtained through the [http://odamex.net website] or from the [[SVN]] repository using a SVN client.
using [http://tortoisesvn.tigris.org/ tortoisesvn].
+
  
 
==Step 5: Compiling the ODAMEX source code==
 
==Step 5: Compiling the ODAMEX source code==
  
After you've extracted the source code to a directory, open the workspace file (currently named odamex.workspace)
+
After you've extracted the source code to a directory, open the workspace file (currently named '''odamex.workspace''').
and go to the '''Build menu''' and click '''Rebuild workspace'''
+
 
 +
Select GCC as the default compiler.
 +
 
 +
If a dialog box asking for information about a global variable "wx" comes up, simply enter C:\mingw\ under base and click enter unless you're planning on compiling the launcher.
 +
 
 +
Once the environment is loaded, double click on the project name (client, server, master), select your target (Debug or Release), go to the '''Build menu''' and click '''Rebuild'''.
  
==Conclusion==
+
==Step 6: Obtaining the runtime libraries==
  
Once its all built (and no errors have occurred), you should find some binary files located in the '''bin''' directory
+
[[Image:codeblocks_bin_directory_final.png|thumb|The required contents of trunk/bin]]
and these are ready to use.
+
  
==External Links==
+
Once its all built (and no errors have occurred), you should find some binary files located in the '''bin''' directory. The only thing that you're likely missing is the SDL and SDL_mixer runtime libraries.  Download the appropriate library for your system from [http://www.libsdl.org/download-1.2.php here] and [http://www.libsdl.org/projects/SDL_mixer/ here]. Also, make sure to copy odamex.wad and your IWAD of choice to the '''bin''' directory as well.  Once finished, your directory should probably look something like shown in the screenshot.
* [http://www.codeblocks.org/ Code::Blocks]
+
* [http://www.libsdl.org SDL]
+
* [http://www.libsdl.org/projects/SDL_mixer SDL_mixer]
+

Latest revision as of 04:53, 29 February 2008

The ODAMEX Source package comes with a variety of project and workspace files.

This tutorial will show you how to build ODAMEX using the Code::Blocks IDE.

Step 1: Getting Code::Blocks

You can download Code::Blocks from its website here: Code::Blocks. Be sure to get the latest release installer WITH MinGW

Step 2: Setting up the compiler

Windows

Download the installer and run it, but don't start Code::Blocks yet.

Linux

Chances are, your linux installation already has all the necessary programs. If not, refer to your individual distribution's installation methods for installing gcc, gnu make and their appropriate libraries.

Step 3: Required Libraries

Odamex requires the following libraries to compile:

Windows

Copy the include\SDL and lib folders from the archives and paste them into your path-to-codeblocks\MinGW directory, overwriting the old include and lib folders respectively.

Note: You may need to copy the files from include\SDL to the include directory in the path-to-codeblocks\MinGW, otherwise when it comes time to build the client, it will complain about SDL.h missing.

Linux

Refer to your individual distribution's installation methods for installing SDL and SDL_mixer libraries.

Step 4: Getting the source code for ODAMEX

The source code can be obtained through the website or from the SVN repository using a SVN client.

Step 5: Compiling the ODAMEX source code

After you've extracted the source code to a directory, open the workspace file (currently named odamex.workspace).

Select GCC as the default compiler.

If a dialog box asking for information about a global variable "wx" comes up, simply enter C:\mingw\ under base and click enter unless you're planning on compiling the launcher.

Once the environment is loaded, double click on the project name (client, server, master), select your target (Debug or Release), go to the Build menu and click Rebuild.

Step 6: Obtaining the runtime libraries

The required contents of trunk/bin

Once its all built (and no errors have occurred), you should find some binary files located in the bin directory. The only thing that you're likely missing is the SDL and SDL_mixer runtime libraries. Download the appropriate library for your system from here and here. Also, make sure to copy odamex.wad and your IWAD of choice to the bin directory as well. Once finished, your directory should probably look something like shown in the screenshot.