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

From OdaWiki
(Step 6: Obtaining the runtime libraries)
Line 7: Line 7:
 
==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. Don't start codeblocks yet, though.
+
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. Don't start codeblocks yet, though.
  
 
==Step 2: Setting up the compiler==
 
==Step 2: Setting up the compiler==
  
 
===Windows===
 
===Windows===
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.
+
It is assumed here that MinGW is the compiler that will be used with Code::Blocks. 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.
  
You need the latest version of MinGW from [http://sourceforge.net/project/showfiles.php?group_id=2435 this website]. You need the latest stable versions of the following packages...
+
You need the latest version of MinGW from [http://sourceforge.net/project/showfiles.php?group_id=2435 this website]. You need the latest stable versions of the following packages...
 
* mingw-runtime
 
* mingw-runtime
 
* w32api
 
* w32api
Line 21: Line 21:
 
* gdb (not required, but highly recomended for debugging purposes)
 
* gdb (not required, but highly recomended for debugging purposes)
  
Download all of them and extract them to C:\mingw. If you're using Windows and don't have an archiver capable of handling tar.gz files, stop living in the stone age and download [http://www.7-zip.org/ 7-Zip].
+
Download and extract all of these and to C:\mingw. If you are using Windows and don't have an archiver capable of handling tar.gz files, download [http://www.7-zip.org/ 7-Zip].
  
Now start Code::Blocks. You should see a dialog box which lists off various compilers.  You should see '''GNU GCC Compiler: Detected''', click OK to continue.
+
Now start Code::Blocks. You should see a dialog box which lists off various compilers.  You should see '''GNU GCC Compiler: Detected''', click OK to continue.
  
 
===Linux===
 
===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.
+
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==
 
==Step 3: Required Libraries==
  
For ODAMEX to successfully compile, you must obtain some libraries for it, which are:
+
Odamex requires the following libraries to compile:
  
*[http://www.libsdl.org/download-1.2.php SDL Development Libraries]
+
*[http://www.libsdl.org/download-1.2.php SDL Development Library]
*[http://www.libsdl.org/projects/SDL_mixer/ SDL_mixer Development Libraries]
+
*[http://www.libsdl.org/projects/SDL_mixer/ SDL_mixer Development Library]
  
 
===Windows===
 
===Windows===
Line 57: Line 57:
 
[[Image:codeblocks_bin_directory_final.png|thumb|The required contents of trunk/bin]]
 
[[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 and copy odamex.wad and your IWAD of choice to the '''bin''' directory as well.  When finished, your directory should probably look something like the following image.
+
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.
  
 
==External Links==
 
==External Links==

Revision as of 23:11, 3 October 2007

Overview:


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 nightly build, and NOT Release Canadate 2 as this is the one that works with the current project files. Don't start codeblocks yet, though.

Step 2: Setting up the compiler

Windows

It is assumed here that MinGW is the compiler that will be used with Code::Blocks. 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.

You need the latest version of MinGW from this website. You need the latest stable versions of the following packages...

  • mingw-runtime
  • w32api
  • binutils
  • gcc 3 (gcc-core and gcc-g++)
  • gdb (not required, but highly recomended for debugging purposes)

Download and extract all of these and to C:\mingw. If you are using Windows and don't have an archiver capable of handling tar.gz files, download 7-Zip.

Now start Code::Blocks. You should see a dialog box which lists off various compilers. You should see GNU GCC Compiler: Detected, click OK to continue.

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 C:\MinGW\include and C:\MinGW\lib directories respectively.

Linux

Refer to your individual distribution's installation methods for installing the SDL and SDL_Mixer development 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).

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, right click on the part of the project you would like to compile (either client, server, master or launcher) on the left hand pane and click activate project. From there, go to the Build menu and click Rebuild workspace.

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.

External Links