Jump to content

Compiling SDK CodeBlocks Windows: Difference between revisions

From Kingpin Wiki
Created page with "<h3>Introduction</h3> <p><a href="https://en.wikipedia.org/wiki/Code::Blocks" target="_blank">Code::Blocks</a> is a open-source IDE <a href="https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#C.2FC.2B.2B" target="_blank">compared</a> to Microsoft <a href="https://en.wikipedia.org/wiki/Microsoft_Visual_Studio" target="_blank">Visual Studio</a>/<a href="https://en.wikipedia.org/wiki/Microsoft_Visual_Studio_Express" target="_blank">Express</a>...."
 
No edit summary
Line 1: Line 1:
<h3>Introduction</h3>
<h3>Introduction</h3>
<p><a href="https://en.wikipedia.org/wiki/Code::Blocks" target="_blank">Code::Blocks</a> is a open-source IDE <a href="https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#C.2FC.2B.2B" target="_blank">compared</a> to Microsoft <a href="https://en.wikipedia.org/wiki/Microsoft_Visual_Studio" target="_blank">Visual Studio</a>/<a href="https://en.wikipedia.org/wiki/Microsoft_Visual_Studio_Express" target="_blank">Express</a>. <br />The good thing about <a href="https://en.wikipedia.org/wiki/Open-source_software" target="_blank">open-source</a> is that you can use it also in Linux and Mac OS.</p>
<p>[https://en.wikipedia.org/wiki/Code::Blocks Code::Blocks] is a open-source IDE [https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#C.2FC.2B.2B compared] to Microsoft [https://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio]/[https://en.wikipedia.org/wiki/Microsoft_Visual_Studio_Express Express] <br />The good thing about [https://en.wikipedia.org/wiki/Open-source_software open-source] is that you can use it also in Linux and Mac OS.</p>
<p>Altthrough it still needs <a href="https://www.kingpin.info/download/index.php?dir=kingpin/server/unofficial/sdk/compiler/&amp;file=VCToolkitSetup.exe">Visual C++ Toolkit 2003</a>.</p>
<p>Altthrough it still needs [https://www.kingpin.info/download/index.php?dir=kingpin/server/unofficial/sdk/compiler/&amp;file=VCToolkitSetup.exe Visual C++ Toolkit 2003].</p>
<p>After <a href="http://www.codeblocks.org/downloads/binaries" target="_blank">installing Code::Blocks</a> and <a href="https://www.kingpin.info/download/index.php?dir=kingpin/server/unofficial/sdk/compiler/&amp;file=VCToolkitSetup.exe">Visual C++ Toolkit 2003</a> what should be quite easy just run both installers and&nbsp;<a href="http://www.codeblocks.org/downloads/binaries" target="_blank">Code::Blocks</a> should find <a href="https://www.kingpin.info/download/index.php?dir=kingpin/server/unofficial/sdk/compiler/&amp;file=VCToolkitSetup.exe">Visual C++ Toolkit 2003</a> automaticly.</p>
<p>After [http://www.codeblocks.org/downloads/binaries installing Code::Blocks] and [https://www.kingpin.info/download/index.php?dir=kingpin/server/unofficial/sdk/compiler/&amp;file=VCToolkitSetup.exe Visual C++ Toolkit 2003] what should be quite easy just run both installers and [http://www.codeblocks.org/downloads/binaries Code::Blocks] should find [https://www.kingpin.info/download/index.php?dir=kingpin/server/unofficial/sdk/compiler/&amp;file=VCToolkitSetup.exe Visual C++ Toolkit 2003] automaticly.</p>
<p>But if you want more information you could read <a href="http://wiki.codeblocks.org/index.php/Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE" target="_blank">Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE.</a></p>
<p>But if you want more information you could read [http://wiki.codeblocks.org/index.php/Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE.]</p>
<hr style="height: 2px; border-width: 0; background-color: #e7c258;" />
<hr style="height: 2px; border-width: 0; background-color: #e7c258;" />
<h3>Creating a New Project</h3>
<h3>Creating a New Project</h3>
Line 12: Line 12:
<li>Choose from the menu File-&gt;New-&gt;Project..</li>
<li>Choose from the menu File-&gt;New-&gt;Project..</li>
<li>From the New From template dialog choose Projects-&gt;Dynamic Link Library and click Go.</li>
<li>From the New From template dialog choose Projects-&gt;Dynamic Link Library and click Go.</li>
<li>A&nbsp;Dynamic Link Library dialog will start, click on Next.</li>
<li>A Dynamic Link Library dialog will start, click on Next.</li>
<li>Click in the&nbsp;Project title entry and type a name for your project</li>
<li>Click in the Project title entry and type a name for your project</li>
<li>Check the Folder to creat a project in and make sure it's correct and press Next.</li>
<li>Check the Folder to creat a project in and make sure it's correct and press Next.</li>
<li>In the next dialog choose as compiler: Microsoft Visual C++ ToolKit 2003 and make sure that Release is checked and not Debug unless you want that and click on Finish</li>
<li>In the next dialog choose as compiler: Microsoft Visual C++ ToolKit 2003 and make sure that Release is checked and not Debug unless you want that and click on Finish</li>
Line 25: Line 25:
<li>The files main.cpp and main.h are still there you probably want to deleted them in an window explorer, so you don't&nbsp;accidently add them.</li>
<li>The files main.cpp and main.h are still there you probably want to deleted them in an window explorer, so you don't&nbsp;accidently add them.</li>
</ol>
</ol>
<p>Now that we have our project and workspace, we need to add id's&nbsp;<a href="https://www.kingpin.info/download/index.php?dir=kingpin/server/official/sdk/&amp;file=kpsdk.zip">Kingpin SDK source</a> files to the project.</p>
<p>Now that we have our project and workspace, we need to add id's [https://www.kingpin.info/download/index.php?dir=kingpin/server/official/sdk/&amp;file=kpsdk.zip Kingpin SDK source] files to the project.</p>
<ol>
<ol>
<li>Create a new folder in your project directory called "Source"</li>
<li>Create a new folder in your project directory called "Source"</li>
<li>Copy the&nbsp;<a href="https://www.kingpin.info/download/index.php?dir=kingpin/server/official/sdk/&amp;file=kpsdk.zip">Kingpin source</a> files to this directory</li>
<li>Copy the [https://www.kingpin.info/download/index.php?dir=kingpin/server/official/sdk/&amp;file=kpsdk.zip Kingpin source] files to this directory</li>
<li>Under the menu Project-&gt;Add Files..</li>
<li>Under the menu Project-&gt;Add Files..</li>
<li>Change to the source directory you just created</li>
<li>Change to the source directory you just created</li>
Line 34: Line 34:
<li>and click Open.</li>
<li>and click Open.</li>
</ol><hr style="height: 2px; border-width: 0; background-color: #e7c258;" />
</ol><hr style="height: 2px; border-width: 0; background-color: #e7c258;" />
<h3>&nbsp;</h3>
<h3>Fixing the Compiler</h3>
<h3>Fixing the Compiler</h3>
<p>There still some things missing from the compiler the Kingpin SDK. Kingpin needs NavLib.lib otherwise it won't compile.</p>
<p>There still some things missing from the compiler the Kingpin SDK. Kingpin needs NavLib.lib otherwise it won't compile.</p>
Line 58: Line 57:
<table style="width: 300px; border-collapse: collapse;" border="0">
<table style="width: 300px; border-collapse: collapse;" border="0">
<tr>
<tr>
<td style="border-color: #e7c258; border-style: solid; border-width: 2px; text-align: center;"><a href="https://www.kingpin.info/download/index.php?dir=kingpin/server/unofficial/sdk/&amp;file=codeblock.zip">Code::Blocks</a></td>
<td style="border-color: #e7c258; border-style: solid; border-width: 2px; text-align: center;">[https://www.kingpin.info/download/index.php?dir=kingpin/server/unofficial/sdk/&amp;file=codeblock.zip Code::Blocks]</td>
</tr>
</tr>
</table>
</table>

Revision as of 23:09, 19 February 2025

Introduction

Code::Blocks is a open-source IDE compared to Microsoft Visual Studio/Express
The good thing about open-source is that you can use it also in Linux and Mac OS.

Altthrough it still needs Visual C++ Toolkit 2003.

After installing Code::Blocks and Visual C++ Toolkit 2003 what should be quite easy just run both installers and Code::Blocks should find Visual C++ Toolkit 2003 automaticly.

But if you want more information you could read Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE.


Creating a New Project

First, we must create the project in which we are going to work:

  1. Start Code::Blocks
  2. Close any open Workspaces
  3. Choose from the menu File->New->Project..
  4. From the New From template dialog choose Projects->Dynamic Link Library and click Go.
  5. A Dynamic Link Library dialog will start, click on Next.
  6. Click in the Project title entry and type a name for your project
  7. Check the Folder to creat a project in and make sure it's correct and press Next.
  8. In the next dialog choose as compiler: Microsoft Visual C++ ToolKit 2003 and make sure that Release is checked and not Debug unless you want that and click on Finish

Adding Files to the New Project

Before we can add new files t the project you first need to remove the 2 files that were created to the project so we got a emtpy project.

  1. Choose from the menu Project->Remove files..
  2. main.h and main.cpp should already be selected, press OK
  3. A new confirmation dialoog will start, press Yes
  4. The files main.cpp and main.h are still there you probably want to deleted them in an window explorer, so you don't accidently add them.

Now that we have our project and workspace, we need to add id's Kingpin SDK source files to the project.

  1. Create a new folder in your project directory called "Source"
  2. Copy the Kingpin source files to this directory
  3. Under the menu Project->Add Files..
  4. Change to the source directory you just created
  5. Select all the *.c and *.h files from the Kingpin source (make sure you don't add main.cpp and main.h if you have not deleted them)
  6. and click Open.

Fixing the Compiler

There still some things missing from the compiler the Kingpin SDK. Kingpin needs NavLib.lib otherwise it won't compile.

  1. menu Project->Build Options...
  2. Click on the Tab Linker settings
  3. In the Link libaries: add the Navblib.lib file including path
  4. In the Other linker options: add /def:game.def or the path to it for example /def:..\game.def
  5. It already should compile only it still gives LIBC error to remove it, still in Project build options go to name of project and then release, on left side.
  6. Then the Tab Compiler settings
  7. Under Compiler Flags there is flag selected on: Multi-threaded Runtime Library [/MD]
  8. Turn that flag off and click Ok

It should compile now without any errors.

To compile the DLL with the correct name and the correct folder for example in game folder of Kingpin:

  1. menu Project->Properties...
  2. Click on the Tab Build Targets
  3. Output filename: bin\Release\gamex86.dll
  4. and click OK

Download project file

Code::Blocks