Code Blocks with Irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Alpha Omega
Posts: 288
Joined: Wed Oct 29, 2008 12:07 pm

Code Blocks with Irrlicht

Post by Alpha Omega »

I have been using code blocks for a few days making applications but today when trying to create a project I get a strange error. Im am using the GNC compiler but I get errors saying that the crtdefs.h (which is a VC++ header file right?) error: `__int641 does not name a type and follows 60+ errors after that. It all started when I tried compiling a Irrlicht.dll file which code blocks couldn't do. I am using the VC++ 2008 include/lib and have the DX and Windows SDK. Could it be a problem with code blocks?
SwitchCase
Posts: 170
Joined: Sun Jul 01, 2007 11:41 pm
Location: Manchester, UK

Post by SwitchCase »

Im am using the GNC compiler
+
I am using the VC++ 2008 include/lib

There's your problem. You're trying to link to a library compiled with VC++ with a compiler other than VC++. C++ standards do not clarify exactly the definition of various types - therefore different compilers implement different ways of doing things.

Use the GCC lib. By "GNC compiler" I assume your on about the GCC compiler from GNU.
Alpha Omega
Posts: 288
Joined: Wed Oct 29, 2008 12:07 pm

Post by Alpha Omega »

Oh I see what I did wrong. But I got back to the problem I had before. I am trying to compile the Irrlicht.dll file but to gets an error at

Code: Select all

#ifdef _IRR_WINDOWS_
	#include <windows.h>
	#if defined(_DEBUG) && !defined(__GNUWIN32__)
		#include <crtdbg.h>
	#endif
Thats why I linked the VC++ lib to it in the first place. Can anyone help me with this please?[/code]
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

So what's the problem here? The crtdbg is not needed when compiling with gcc, as it uses the usuall assert() for triggering breakpoints.
SwitchCase
Posts: 170
Joined: Sun Jul 01, 2007 11:41 pm
Location: Manchester, UK

Post by SwitchCase »

but to gets an error
What's this error exactly?
I am trying to compile the Irrlicht.dll
Have you successfully built a project that links to the irrlicht.dll already compiled for you?
Frank Dodd
Posts: 208
Joined: Sun Apr 02, 2006 9:20 pm

Post by Frank Dodd »

Are you missing the __GNUWIN32__ under project build options, compiler settings #defines. I use CodeBlocks 8.02 and vaguely recall having a problem with this.
Alpha Omega
Posts: 288
Joined: Wed Oct 29, 2008 12:07 pm

Post by Alpha Omega »

Are you missing the __GNUWIN32__ under project build options, compiler settings #defines.
Yes I was and thank you for your help.
Have you successfully built a project that links to the irrlicht.dll already compiled for you?
I have built some of the tutorials that come with the engine but they all say "DIRECT3D9 is not supported with the current .dll file" or something close to that so I thought maybe I needed to compile a more updated Irrlicht.dll file?
*******
I compiled the new Irrlicht.dll file but it did not solve the "Direct3D9 is not supported with the current .dll file".
magfuse
Posts: 12
Joined: Sun Dec 21, 2008 9:06 pm

Irrlicht.dll issue and Linking Problems???

Post by magfuse »

I am having an issue linking using code blocks I have just switched over to this ide and I want to define the library locations.

I can compile examples if I relocate the precompiled irrlicht.dll found in the bin. But I couldn't compile the demo using IrrKlang. How can i set up the ide to find my libs and includes. And other libraries i choose to use in the future?

PS> I compiled irrlicht from the source and I am getting the same issue as Alpha Omega of not being able to use directx. I believe I have directX 10? Any ideas? or can i link to the precompiled dll instead?
magfuse
Posts: 12
Joined: Sun Dec 21, 2008 9:06 pm

Code Blocks linking

Post by magfuse »

so I found out how to link using the build options in code blocks. Rt click on the project and select build options then I can add libraries in the Linker Settings tab and other search directories in the next tab.

After compiling the Irrlicht source i can no longer use directX in the examples... I used to be able to. So I can no clue what version of Irrlicht.dll is linked =/ How do I find the linker is looking?

Also after linking IrrKlang and compiling I no longer have sound in the Demo project. I used to have sound everytime I clicked or pressed space. No build errors and I made sure to use IrrKlang the CDemo.h file.

I would like to get the linking part down so i can move on to deciphering the demos. Any help is appreciated. Thanks.
magfuse
Posts: 12
Joined: Sun Dec 21, 2008 9:06 pm

link for other newbs.

Post by magfuse »

So i found this link... maybe it will help others:

http://irrlicht.sourceforge.net/tut_codeblocks.html

NOTE: many of the links to libs don't work.
I didn't know I need so many other dependencies...

I am still having issues but I am going to take a break and then come back later.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

the tutorial you found seems to use C::B with the MSVC libs, but as far as you're using C::B with gcc you can also check my tutorial at http://abusoft.g0dsoft.com, it's realy simple to use... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
magfuse
Posts: 12
Joined: Sun Dec 21, 2008 9:06 pm

Post by magfuse »

Acki wrote:the tutorial you found seems to use C::B with the MSVC libs, but as far as you're using C::B with gcc you can also check my tutorial at http://abusoft.g0dsoft.com, it's realy simple to use... ;)
Its a good tutorial expect for one part didn't work for me. When you type "Irrlicht" for the lib. My compiler doesn't work like that. I had to actually find the lib file. "Irrlicht.a"
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

magfuse wrote:When you type "Irrlicht" for the lib. My compiler doesn't work like that. I had to actually find the lib file. "Irrlicht.a"
that's because libs for gcc usually named libMyLib.a,
so the Irrlicht lib should be named "libIrrlicht.a" and not just "Irrlicht.a" !!! ;)
if you rename it you'll see it works like I discribed !!! 8)
but that doesn't affect any usability though... :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
magfuse
Posts: 12
Joined: Sun Dec 21, 2008 9:06 pm

Post by magfuse »

Acki wrote:
magfuse wrote:When you type "Irrlicht" for the lib. My compiler doesn't work like that. I had to actually find the lib file. "Irrlicht.a"
that's because libs for gcc usually named libMyLib.a,
so the Irrlicht lib should be named "libIrrlicht.a" and not just "Irrlicht.a" !!! ;)
if you rename it you'll see it works like I discribed !!! 8)
but that doesn't affect any usability though... :lol:
It works!!! Thank You! I was using $(IrrKlangLIB)\libirrKlang.a and $(IrrLIB)\libirrKlang.a -- Custom variables. This is much more efficient. :lol:

I am not getting the "-1Irrlicht not found" error since I updated the search directories. Thanks for your tutorial!
Post Reply