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

From OdaWiki
Line 1: Line 1:
== Overview ==
+
In this article, we will learn how to compile the Odamex Launcher which uses the wxWidgets API, you will need to [Compiling_using_Code::Blocks take these steps] before continuing with this article.
In this article, we will learn how to compile the odamex launcher which uses the wxWidgets API
+
  
== Compiling on Windows ==
+
== Getting wxWidgets ==
  
=== Compiling wxWidgets ===
+
=== Windows ===
 
+
You will need to download the latest '''MSW''' package from the [http://www.wxwidgets.org wxWidgets website].
You will need to download the wxMSW package from the wxWidgets website, the latest version.
+
  
 
After that, extract everything to a directory of your choice, preserving directory structure.
 
After that, extract everything to a directory of your choice, preserving directory structure.
  
====IF YOU INSTALLED THE CODEBLOCKS+MINGW COMBO PACKAGE====
+
=== Linux ===
If you initially install codeblocks with mingw included, everything is contained in your codeblocks directory.  This has some nice benefits but unfortunately there's a couple things to do before you build wx.
+
Refer to your distributions instructions on installing wxWidgets.
  
1. Add the bin dir in your codeblocks location (usually c:\program files\codeblocks\bin) to your PATH. 
+
== Compiling wxWidgets ==
  
2. Copy cc1.exe, cc1plus.exe and collect2.exe from codeblocks\libexec\gcc\mingw32\3.4.4 to codeblocks\bin
+
=== Windows ===
 
+
Open a command prompt window, go to '''your-wxwidgets-dir\build\msw''' directory and type:
Then continue...
+
 
+
 
+
Open a command prompt window, navigate to this directory, go to the build\msw subdirectory and type:
+
  
 
<pre>
 
<pre>
Line 26: Line 20:
 
</pre>
 
</pre>
  
This process will take a while, you should end up with some libraries in the lib\gcc_lib folder after its built, these are the compiled wxWidgets libraries.
+
This process will take a while, you should end up with some libraries in the '''lib\gcc_lib''' folder after its built, these are the compiled wxWidgets libraries.
  
=== Compiling XML Resource files ===
+
== Compiling wxrc ==
 +
Go back to the wxWidgets root directory, navigate to the '''utils\wxrc''' sub-directory and type the same command line in the command prompt that you compiled wxWidgets with, this will build wxrc.
  
(This is optional, only do this if you want to change the layout of your launcher!)
+
== Compiling the Launcher ==
 
+
Open Code::Blocks and navigate to the Settings->Global Variables menu,
In the wxWidgets root directory, navigate to the utils\wxrc sub-directory and type the same command line in the command prompt that you compiled wxWidgets with, this will build wxrc.
+
 
+
After that, copy the wxrc.exe file from one of the subdirectories inside utils\wxrc to the odalaunch\res dir in your odamex root directory
+
 
+
Now, In the odalaunch\res sub-directory, type this into the command prompt:
+
 
+
<pre>
+
wxrc /c /o res/xrc_resource.h res/dlgmain.xrc res/dlgconfig.xrc
+
</pre>
+
 
+
This will compile the XML Resource (*.xrc) files into a C header file.
+
 
+
=== Compiling the launcher ===
+
 
+
Open codeblocks and navigate to the Settings->Global Variables menu,
+
 
select "wx" as your current variable if it isn't already selected.
 
select "wx" as your current variable if it isn't already selected.
In the ''base'' field, type in the path of your wxWidgets directory and close the dialog.
+
In the '''base''' field, type in the path of your wxWidgets directory and close the dialog.
 
+
Now open the ''odamex.workspace'' file located in your odamex source directory, right click on the launcher project and select ''Activate project''. Now go to the ''Build Target:'' combo box in the toolbar below the main menu and select ''Win Release'', go to the ''Build menu'' and click ''Rebuild'' and click Yes, this will build the launcher and output the binary/executable in the bin directory in the odamex source directory.
+
  
== External Links ==
+
Open your '''odamex.workspace''' in Code::Blocks and double-click on the Launcher project, select '''Release''' build target, go to the '''Build''' menu and hit '''Rebuild'''.
  
[http://www.wxwidgets.org wxWidgets website]
+
If all went well, you should see an '''odalaunch''' binary in the '''bin''' directory of your Odamex source directory.

Revision as of 05:54, 29 February 2008

In this article, we will learn how to compile the Odamex Launcher which uses the wxWidgets API, you will need to [Compiling_using_Code::Blocks take these steps] before continuing with this article.

Getting wxWidgets

Windows

You will need to download the latest MSW package from the wxWidgets website.

After that, extract everything to a directory of your choice, preserving directory structure.

Linux

Refer to your distributions instructions on installing wxWidgets.

Compiling wxWidgets

Windows

Open a command prompt window, go to your-wxwidgets-dir\build\msw directory and type:

mingw32-make -f makefile.gcc MONOLITHIC=0 UNICODE=0 SHARED=0 BUILD=release

This process will take a while, you should end up with some libraries in the lib\gcc_lib folder after its built, these are the compiled wxWidgets libraries.

Compiling wxrc

Go back to the wxWidgets root directory, navigate to the utils\wxrc sub-directory and type the same command line in the command prompt that you compiled wxWidgets with, this will build wxrc.

Compiling the Launcher

Open Code::Blocks and navigate to the Settings->Global Variables menu, select "wx" as your current variable if it isn't already selected. In the base field, type in the path of your wxWidgets directory and close the dialog.

Open your odamex.workspace in Code::Blocks and double-click on the Launcher project, select Release build target, go to the Build menu and hit Rebuild.

If all went well, you should see an odalaunch binary in the bin directory of your Odamex source directory.