Page 1 of 1

[How-To]Use Irrlicht with code::blocks and win32 dlls/libs

Posted: Mon Dec 04, 2006 9:37 pm
by Kamazy
Ok, Here's how to use Code::Blocks with irrlicht win32 dll/lib.

The Main reason for using the win32 dll/lib is becouse (IMHO) it's much better then the GCC version.

Ok, let's start:

1. Downlaod CODE::BLOCKS
http://prdownloads.sourceforge.net/code ... e?download
There's a downlaod without the GCC compiler but i didn't use that one.

2. Downlaod visual studio 2003 toolkit
http://xona.com/programs/VCToolkitSetup ... 07.06).zip
Copy ALL above link and paste into browser. (Clicking on it won't work)
Finding this was hard. :P (Windows stoped all it's 2003 toolkit downlaods)
[Comment]
So, if someone could uplaod it to some other place so we know it will allways be there that would be great. :)
[/Comment]

3. Install Code::Blocks and 2003 toolkit. ( I Asume you know how to install software)

4. In the tutorial i'll assume you installed 2003 toolkit in (C:/Microsoft Visual C++ Toolkit 2003" and code::blocks in (C:/CodeBlocks) and Irrlicht in (C:/Irrlicht)
Now that you have all the needed software let's set up code::blocks.

5. Start code::blocks, in will show you a text box that it detected the compilers (Code::blocks auto detects the compilers), just press the "Ok" (can't remember the axact button text :P).

6. Now lets just make sure that code::blocks detected the toolkit03 compiler.
6a. goto "Build->compiler options", you'll get a new window where you can change the compiler settings, under "Selected compiler" there's "GNU GCC Compiler" click on it and you'll get a few other compilers (you don't have all of them) and click "Microsoft visual c++ toolkit 2003"

6a. Now click on the "Programs" tab and then click the "auto detect" button. and a "auto detected installasion path of...". ok now the programs should be detected.

6b. Click the "directories" tab, under the "Compiler" you should have "C:\Microsoft Visual C++ Toolkit 2003\include" if not click the add button and add "C:\Microsoft Visual C++ Toolkit 2003\include" (Note i assume you installed MSVC++ TK 03 in "C:\Microsoft Visual C++ Toolkit 2003")
now click on the "linker" tab and check if "C:\Microsoft Visual C++ Toolkit 2003\lib" is in. if not add it.

Ok, now the compiler should be configured,

7. start a new project "File->New Project...", there's a "Irrlicht project" template click on it and under optians select "Free microsoft visual c++ toolkit 2003 project" (This is the compiler)
Ok, now click "Create", and save your projecy somewhere, after witch you'll get a message saing that code::blocks expects irrlicht to be in "C:/Irrlicht"(We'll change that)

8. Now go to "Project->Build Options", under "Irrlicht Project" click "default", now click the "Directory" "Compiler" and add the "C:/Irrlicht/include", now the "linkers" tab and add "C:\irrlicht\lib\Win32-visualstudio"
And after all that now click "Ok"

9. Copy the "Irrlicht.dll" into your project directory.

10. Now "Build->Build" (ctrl-F9), and "Build->Run".

If you did everything right irrlicht should start with no problem.

You can now save this template for later use.
"Project->Save project as user-template" and save this as a tempalte so you can later create it again and don't have to go threw this again.

Saved tempaltes and in "File->New project" "User Templates" tab.

That should be all. (if i didn't forget anything. :P)


Reason for using win32 dll/lib instead of GCC version:
1. DirectX is compiled into it and you don't need to recompile irrlicht with DX support.
2. Not sure but the win32 seem to run a few frames faster then GCC.
3. I'm sure there's more but those are enough reason for me. :)

Main reason i use win32 dll/lib is becouse on my laptop when i try to use GCC compiled irrlicht (with DX) it crashed when i try to use dx8/9 drivers.
So my guess it that win32 vesrion in more stable then GCC version in some cases, And i like knowing that even if some1 is tring to downlaod and play my game from a laptop it would work fine.


Other NOTE: Some irrlicht tutorials use "windows.h" witch you'll need the "Microsoft Platfork sdk"'s include and lib in order to use it. This isn't 100% needed in order to sue irrlicht.
But here's a link to it incase you want to use it. (You should know how to set it up if you did this tutorial)
Windows® Server 2003 SP1 Platform SDK Web Install
just install the minimum options. without tools and stuff. all you need is the "inlcude" and "libs" directories.

Last Note:
MSVC++ Toolkit 2003 doesn't include a debugger.
If anyone has a debuger that can be integrated into code::blocks that'll be great. :)

Posted: Tue Dec 05, 2006 12:02 pm
by CmdKewin
Aren't you supposed to be using Nightly Builds for the VS2003 compiler to worK?


Anyways, how is the GCC library "worse" than the WIN32 one? Aside from pure size (which i'm not entirely sure either), the are practically identical. Besides the fact that MingW is fully POSIX compliant. Which the vc++ 7.1 compiler is not.

Posted: Tue Dec 05, 2006 1:29 pm
by mispunt
VS2003 is supported by RC2, but a Nightly build will work better ;)

Posted: Tue Dec 05, 2006 4:58 pm
by Kamazy
Aren't you supposed to be using Nightly Builds for the VS2003 compiler to worK?
Not sure but this one seems to work fine for me.
Anyways, how is the GCC library "worse"...
Here,
Main reason i use win32 dll/lib is becouse on my laptop when i try to use GCC compiled irrlicht (with DX) it crashed when i try to use dx8/9 drivers.

Posted: Tue Dec 05, 2006 7:11 pm
by hybrid
That's because you have to recompile the mingw dlls with D3D drivers enabled. You could avoid the crash by checking that driver!=0 before using it ...

Posted: Tue Dec 05, 2006 9:18 pm
by Kamazy
The problem is not runing irrlicht, but runing irrlicht with DX8/9 on my laptop.
The dll and lib works just fine on PC but not on my laptop and for that reason i chose to use the win-32 dll and not the GCC.
And i do use a compiled irrlicht with dx.

Posted: Wed Dec 06, 2006 11:46 am
by CmdKewin
Uhm. Seems like a good reason... ;) Mostly because i've got the same problem with opengl. My integrated work-laptop refuses to run opengl properly (the video card crashing on me every 10 minutes) while on my home-desktop i've got no problems at all. No difference by using gcc or win32. So i'll stick to DX9 gcc on codeblocks, which works flawlessly on both machines :D No linux port, but hey, that's not one of the requiremens, so who cares. ;)

Posted: Thu Dec 07, 2006 12:46 am
by Kamazy
If GCC works fine for you then use it. :P
But for people who want to use win-32 with code::blocks, now they have a tutorial on doing that.

Posted: Fri Dec 08, 2006 11:18 am
by Midnight
Kamazy wrote:But for people who want to use win-32 with code::blocks, now they have a tutorial on doing that.

umm we always did!!! 8)
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=8437

hope you hadn't wasted too much time on this.

maybe you should take a stroll through the forum bud.

of course I highly suggest you use the free VC++ compiler that made the toolkit obsolite or so i was told.

personally I'm only using this cause i had an issue with VC and not reformating yet.

Posted: Fri Dec 08, 2006 3:35 pm
by Kamazy
Oh well. :P

Anyways i also find out that the FREE visual c++ 8.0 in better then code::blocks when it comes to win32 compiling. ;P

Posted: Sat Dec 09, 2006 1:34 am
by Midnight
free VC++ compiler that made the toolkit obsolite.

like i said. 8)