Page 1 of 2

Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 9:18 am
by Memorial76
I've just installed Irrlicht 1.8 and I have a new error code when building solution:
5>GuiTest.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
5>IrrGerap.lib(SceneTreeView.obj) : error LNK2005: "public: __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::Float_t(float)" (??0Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@QAE@M@Z) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(SceneTreeView.obj) : error LNK2005: "public: bool __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::sign(void)const " (?sign@Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@QBE_NXZ) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(SceneTreeView.obj) : error LNK2005: "public: __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::Float_t(float)" (??0Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@$$FQAE@M@Z) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(SceneTreeView.obj) : error LNK2005: "public: bool __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::sign(void)const " (?sign@Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@$$FQBE_NXZ) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(EventReceiver.obj) : error LNK2005: "public: __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::Float_t(float)" (??0Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@QAE@M@Z) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(EventReceiver.obj) : error LNK2005: "public: bool __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::sign(void)const " (?sign@Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@QBE_NXZ) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(EventReceiver.obj) : error LNK2005: "public: __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::Float_t(float)" (??0Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@$$FQAE@M@Z) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(EventReceiver.obj) : error LNK2005: "public: bool __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::sign(void)const " (?sign@Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@$$FQBE_NXZ) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(GuiManager.obj) : error LNK2005: "public: __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::Float_t(float)" (??0Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@QAE@M@Z) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(GuiManager.obj) : error LNK2005: "public: bool __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::sign(void)const " (?sign@Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@QBE_NXZ) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(GuiManager.obj) : error LNK2005: "public: __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::Float_t(float)" (??0Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@$$FQAE@M@Z) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>IrrGerap.lib(GuiManager.obj) : error LNK2005: "public: bool __thiscall `bool __cdecl irr::core::equalsByUlp(float,float,int)'::`2'::Float_t::sign(void)const " (?sign@Float_t@?1??equalsByUlp@core@irr@@YA_NMMH@Z@$$FQBE_NXZ) already defined in IrrGerap.lib(GuiMetaElement.obj)
5>C:\Users\PROPRIETAIRE\Documents\Visual Studio 2010\Projects\LibTest\Debug\LibTest.exe : fatal error LNK1169: one or more multiply defined symbols found
5>
5>Build FAILED.
I mention that i didn't change anything in my code exept that I installed Irrlicht 1.8

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 9:43 am
by CuteAlien
Seems you also have a Float_t in your headers :-(

I didn't expect this to be a problem, isn't that inside the irrlicht namespace? I have to experiment a little... as a workaround - modify in irrMath.h in when the Float_t and just rename it for example to irrFloat_t. You don't even need to recompile the library for that (you can, but it doesn't matter). I probably have to change that for next version. But maybe also take a look that you don't have some global "using namespace irr" somewhere.

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 10:02 am
by Memorial76
Thanks for your answer.

I don't know if I have a Float_t anywhere. Yet, I tried to replace Float_t with irrFloat_t and It didn't work. Maybe this is due to the fact that I use Irrlicht through Irrlicht.dll. I should then rebuid Irrlicht, shouldn't I?
But I don't know how to do it. Which .sln should I load?

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 11:06 am
by CuteAlien
No, there shouldn't even need to be a need to rebuild it. But looking more at the error - it seems to use the namespace, so this shouldn't even happen. What is this IrrGerap lib?

edit: Ok, seeing it in your .sig right now.

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 11:12 am
by CuteAlien
You are using using namespace irr; in a header. I'm not yet certain how this is related (only took a quick 1-minute look at your lib), but this is something you should never do. Write the full names in headers. The using namespace thing should only ever be used in .cpp files.

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 12:23 pm
by Memorial76
I try this. It may take a little time to fix all files...
Thanks

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 12:34 pm
by Memorial76
I tried, but nothing changes... :(

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 12:55 pm
by CuteAlien
Still better not having this in headers. But I have downloaded your code from sourceforge, I will try to find some time on the weekend to test out what's going on.

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 3:33 pm
by Memorial76
Thanks a lot for your interest.
This code is quite an old version. Anyway, it is something interesting to have an external look at it.

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Fri Nov 09, 2012 3:57 pm
by Memorial76
For now I just removed the equalsByUlp function from irrMath.h and it works.

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Sun Nov 11, 2012 6:34 pm
by CuteAlien
The code you have on sourceforge compiles here (using VS 2020). But it seem to be rather old, so probably not the same code. Can't help without having an example to reproduce this... please update the code there or produce some example with which I can test this.

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Sun Nov 11, 2012 10:38 pm
by hybrid
VS 2020 :shock:

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Sun Nov 11, 2012 10:45 pm
by CuteAlien
+/- one decade ;-)

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Sun Nov 18, 2012 9:30 am
by Memorial76
Sorry for the delay,
I uploaded the new version of IrrGerap. I removed the example project and just provided all required (I hope) .h and .cpp.

Do not hesitate to DL, test and tell me if something goes wrong.
Thanks a lot

Re: Problem with equalsByUlp since Irrlicht 1.8

Posted: Mon Nov 19, 2012 4:06 pm
by CuteAlien
Hm, Sourceforge release isn't really thought for putting individual source-files there. For that you should use svn (otherwise one has to download each file one-by-one by hand now).

Also removing project files is not a good idea - I need _exactly_ what you have to reproduce the problem. I just added all your files into a project file, but that was again just a waste of time as I can't reproduce it that way. Please give me a project which fails compiling (well, linking in this case) - I have otherwise no idea how to reproduce that problem as it doesn't really make sense to me so far. Maybe you use some specific flags, or do static linking or... I really can't tell.