Page 1 of 1

Problems with Static Linking and Dev-C++

Posted: Thu Jan 22, 2009 10:42 pm
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?

Posted: Fri Jan 23, 2009 4:49 pm
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?

Posted: Fri Jan 23, 2009 7:13 pm
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.