Compilation errors

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
azerty
Posts: 4
Joined: Wed Aug 07, 2024 6:08 pm

Compilation errors

Post by azerty »

Hello,

I use VS 2019 with SDK version 142 and Irrlicht version 1.8.5. I can't compile
my program because of two strange errors.

Erreur C2451 une expression conditionnelle de type 'const B' est non valide STU C:\Users\User\source\repos\STU.Irrlicht\STU\include\irrString.h 364

Erreur C2440 'cast de type' : impossible de convertir de 'const B' en 'T'
STU C:\Users\User\source\repos\STU.Irrlicht\STU\include\irrString.h 378

Does somebody knows the answer? I hope so.

Thanks for any help,
azerty
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Compilation errors

Post by CuteAlien »

Isn't the full error longer? It should also give the line which is calling this function. My first guess is that you try to assing some non-string object to a string (edit: or to be more exact the pointer to a non-string object to a string).
And yeah - I wish that Irrlicht function were written in another way (back then the coder assumed automatic string conversions are good thing and now it's used so much I can't remove this one easily anymore).
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
azerty
Posts: 4
Joined: Wed Aug 07, 2024 6:08 pm

Re: Compilation errors

Post by azerty »

Hello,

I've found the error. It was a typo error.

Code: Select all

Instead of: cubeTex[i] = driver->getTexture(cubeTexPath[i]);
I've written: cubeTex[i] = driver->getTexture(cubeTex[i]);
This is why irrString was lost :)

Happy coding,
azerty
Post Reply