Home - Forums - Documentation - Gallery - Bugs
(Step2: Creating the project)
Current revision (18:24, 24 March 2008) (edit) (undo)
m
 
Line 77: Line 77:
-
Now click to the ''Add...'' button, and add ''libopengl32.a, libgdi32.a, libuser32.a and libkernel32.a'' from you MinGW/lib
+
Now click to the ''Add...'' button, and add ''libcrystalspace.lib'' from your ''CS\out\msysx86\optimize\libs'' directory, and ''libopengl32.a, libgdi32.a, libuser32.a and libkernel32.a'' from you MinGW/lib directroy. The order does matter so make sure that ''libcrystalspace.lib'' is first on the list.
-
 
+
-
directroy, and ''libcrystalspace.lib'' from your ''CS\out\msysx86\optimize\libs'' directory.
+

Current revision

Contents

Creating an external CS project using Code::Blocks Studio

Preparation

This tutorial shows you step by step, how you can use Code::Blocks Studio IDE to compile your own CS and CEL applications.

First, you have to configure, build and install (and optionally CEL) using MinGW and MSYS . You have to set the CRYSTAL

enviroment correctly (and CEL, when you use it). Next step is installing Code:.Blocks IDE. When you use Windows, you have to

download the pure IDE without compiler, to avoid problems. So install and run the IDE.

Step1: Setting the correct compiler

Run Code::Blocks. Go to the Build->Compiler settings:

Image:cb_step1.jpg


The following window awaits you:

Image:cs_step2.jpg


When your default compiler is not GCC, then select form the Selected compiler' list the GNU GCC complier, then click to the Set as default button. Now click to the Programs tab. You can see something, like this:

Image:cs_step3.jpg

Now we set up the path of the mingw compiler. To do this, add our installed MinGW/bin path to the Additinal path: So click to this tab:

Image:cs_step4.jpg

Now click to the Add button, and select your MinGW/bin directory. on my system, it is the E:/MinGw/bin:

Image:cs_step5.jpg


Almost done. Now copy up this path into the Compiler's installation directory edit box:

Image:cs_step6.jpg

Step2: Creating the project

Ok, now create a new console project. Click on the New->New project nad select New console project wizard. Check on the do not create any file option. We use the simple1 source to test our work. When done, add to the sources the following files:

CS/apps/tutorial/sipmle1/simple.1.h CS/apps/tutorial/sipmle1/simple.1.cpp

You can do it easily by right click on the Console application, and select Add Files.. :

Image:cs_step7.jpg


Navigate to your CS/apps/tutorial/simple1/ directory, and add to thep project the files:

Image:cb_step8.jpg

Step3: Adding include files

Now we set up the CS include files. Go to the Build->Complier options and click to the include tab. Click to the

Add.. button, and add your CS/include directory.

Image:cb_step8b.jpg

Step4: Adding libraries

No we add to our project the neccessary library files. We need two at least, libcrystalspace.a for the Crystal Space classes,

and

the neccessary windows libraries. Go to Build->Compiler options, and  click to the Linker tab:

Image:cb_step9.jpg


Now click to the Add... button, and add libcrystalspace.lib from your CS\out\msysx86\optimize\libs directory, and libopengl32.a, libgdi32.a, libuser32.a and libkernel32.a from you MinGW/lib directroy. The order does matter so make sure that libcrystalspace.lib is first on the list.


Image:cb_step10.jpg

Now press Ctrl+F9, to compile the code. Wait. When you see this message, everything is fine:


Image:cb_step11.jpg

| Article | Discussion | View source | History |