Problems with Static Linking and Dev-C++

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
Mequa
Posts: 13
Joined: Fri Jul 07, 2006 7:39 pm

Problems with Static Linking and Dev-C++

Post by Mequa »

I am having trouble getting the Irrlicht examples (v1.5) to correctly compile and run with the Irrlicht library statically linked in Dev-C++ (in Windows Vista).

As an example of this problem, if I open the Collision example (#7) by loading its "example.dev", I can compile and run successfully using the Irrlicht.dll. However, I haven't had much success with the static library and this example.

To show how I attempted this:

I downloaded the latest build containing the static library from http://irrlicht.convextech.ca/ , then changed the linker options to the correct static .a file (around 11 MB), and added -D_IRR_STATIC_LIB_ to the C++ compiler options. I also added -lgdi32 -lopengl32 -lglu32 -lm -lwinmm to the linker options (after the Irrlicht library, on separate lines).

It compiled fine with no warnings, but crashed on run.
The debugger reported an error in the setMaterialTexture() function in the ISceneNode.h file on line 405:
getMaterial(i).MaterialType = newType;

It also gave an error: "Could not watch this variable".

I tried various linker configurations after googling, including various orders. Still no luck.

What am I missing?
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Switch to Code::Blocks or MS Visual Studio Express. Creating a static lib works with both of them.

@devs:
Why don't you remove the dev project file from the SDK?
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

1) Dev-C++ is just using mingw, so it should be able link against a static lib.

2) I don't use Dev-C++ so I don't know why it doesn't link, and I (personally) won't be supporting the .dev projects. It would be great if those users who want to keep using it submit patches to keep them up to date.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply