What is Identity material?

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
Gandalf_the_grey
Posts: 2
Joined: Sun Dec 10, 2023 3:20 pm

What is Identity material?

Post by Gandalf_the_grey »

Hi there, I am trying to use some custom scene nodes in the Irrlicht engine. I tried the sample example that comes with the engine and it works fine.
But when I am using a scene node class like the one posted by @cutealien here at the Github repo.
https://github.com/mzeilfelder/irr-play ... ree/master.

but I am getting this linker error.
Error LNK2001 unresolved external symbol "class irr::video::SMaterial irr::video::IdentityMaterial" (?IdentityMaterial@video@irr@@3VSMaterial@12@A)
This is how I am using the grid node in my app

Code: Select all

  CGridSceneNode* gridNode = new CGridSceneNode(SceneManager->getRootSceneNode(), SceneManager, -1);
 gridNode->drop();
So, why I am getting this IdentityMaterial linking error, when everything works fine If I use inbuilt scene nodes this only happens when I try to use custom scene nodes. I am using the stable branch of irrlicht version 1.8.5.

Any help on the topic is appreciated.
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: What is Identity material?

Post by CuteAlien »

Irrlicht has a few external (global) variables, this is one of them.You get the linker warning as soon as your application needs that variable in some way. The fix is to link Irrlicht correctly.

I think this typically happens when you try to link Irrlicht statically but compiled the dynamic version of it in VisualStudio. If that's the case, recompile Irrlicht using using the static library target. And you must also have defined _IRR_STATIC_LIB_ in your application (sorry, I'm not on Windows right now, but there is some place in project settings of your application where you can set defines).

Or work with the dynamic version (DLL).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Gandalf_the_grey
Posts: 2
Joined: Sun Dec 10, 2023 3:20 pm

Re: What is Identity material?

Post by Gandalf_the_grey »

Thanks for the quick response @cuteAlien, You were right, Although I was compiling the whole irrlicht engine each time my app gets compiled, I forgot totally to remove the Static lib definitions from my app's preprocessor definition. It worked as soon as I removed the _IRR_STATIC_LIB_ definition and the grid node works amazingly great.

Thanks a lot, without you, I would never be able to figure out the issue, it solves a lot of other issues as well.
Post Reply