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

From OdaWiki
(Not complete)
 
(41 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<b>Overview:</b>
+
The ODAMEX Source package comes with a variety of project and workspace files.
---------
+
This guide contains information on how to compile
+
Odamex using [http://www.codeblocks.org/ Code::Blocks]
+
  
=Download=
+
This tutorial will show you how to build ODAMEX using the Code::Blocks IDE.
  
*Download [http://tortoisesvn.tigris.org/ tortoisesvn] and <b>install</b>, then <b>restart</b>.
+
==Step 1: Getting Code::Blocks==
  
=MingW 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'''
*Get the following <b>MinGW</b> files:
+
  
[url=http://prdownloads.sf.net/mingw/gcc-core-3.4.2-20040916-1.tar.gz?download/
+
==Step 2: Setting up the compiler==
        gcc-core-3.4.2-20040916-1.tar.gz]
+
  
[li][url=http://prdownloads.sf.net/mingw/gcc-g++-3.4.2-20040916-1.tar.gz?download]
+
=== Windows ===
        gcc-g++-3.4.2-20040916-1.tar.gz[/url][/li]
+
Download the installer and run it, but don't start Code::Blocks yet.
[li][url=http://prdownloads.sf.net/mingw/mingw-runtime-3.9.tar.gz?download]
+
        mingw-runtime-3.9.tar.gz[/url][/li]
+
[li][url=http://prdownloads.sf.net/mingw/w32api-3.6.tar.gz?download]
+
        w32api-3.6.tar.gz[/url][/li]
+
[li][url=http://prdownloads.sf.net/mingw/binutils-2.15.91-20040904-1.tar.gz?download]
+
        binutils-2.15.91-20040904-1.tar.gz[/url][/li]
+
[li][url=http://prdownloads.sf.net/mingw/mingw32-make-3.80.0-3.exe?download]
+
        mingw32-make-3.80.0-3.exe[/url][/li]
+
[li][url=http://prdownloads.sf.net/mingw/gdb-5.2.1-1.exe?download]
+
        gdb-5.2.1-1.exe[/url][/li]
+
[/list]
+
  
==Community==
+
===Linux===
* [[Policy]]
+
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:
  
== External links ==
+
* [http://www.libsdl.org/download-1.2.php SDL Development Library]
 +
* [http://www.libsdl.org/projects/SDL_mixer/ SDL_mixer Development Library]
  
* [http://bugs.odamex.net/ Odamex Bug Tracker]
+
===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 [http://odamex.net 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==
 +
 
 +
[[Image:codeblocks_bin_directory_final.png|thumb|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 [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.

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.