Hello,
i found, that if i link Irrlicht statically, it can happen that i get "multiple DllMain" errors (depending on other libraries, that probably also have a DllMain).
It happens for example with Curl, if you also link Curl statically.
What about changing in Irrlicht.cpp
#if defined( _IRR_WINDOWS_API_ )
to
#if defined( _IRR_WINDOWS_API_ ) && ! defined( _IRR_STATIC_LIB_ )
?
[fixed]DllMain in Irrlicht.cpp
Re: DllMain in Irrlicht.cpp
Yeah, that looks also more correct to me. Changed in r4904 in trunk. I'm not on Windows right now, so I hope I don't mess up, but looks rather risk-free to me. Feedback if it works is welcome.
Thanks for reporting.
Thanks for reporting.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [fixed]DllMain in Irrlicht.cpp
It works.
I discovered this problem when compiling SpaceCombat. SpaceCombat NEEDS a static Irrlicht lib, because it inherits Classes directly from Irrlicht classes, and that only works if linked statically. So far so good. BUT SpaceCombat also uses Curl ( also as a static lib ), and Curls seems ALSO to have a DllMain in the static build - and bang! Now of course i could link Curl as a dynamic lib, but i don't want to mess around with the settings. Anyway - having DllMain out of the static Irrlicht lib is the right thing to do; maybe someone else has problems with this together with other static libs.
Because we are talking about libs here - i have another "proposal":
- the dynamic Irrlicht lib should be named "libIrrlicht.dll.a" with the dll itself having the name "Irrlicht.dll" ( on Windows - i am not sure about naming conventions on Linux ).
- the static lib stays with it's present name "libIrrlicht.a".
This way we can build both without name clashes.
But this is not important right now - maybe something for Irrlicht 2.0.
I discovered this problem when compiling SpaceCombat. SpaceCombat NEEDS a static Irrlicht lib, because it inherits Classes directly from Irrlicht classes, and that only works if linked statically. So far so good. BUT SpaceCombat also uses Curl ( also as a static lib ), and Curls seems ALSO to have a DllMain in the static build - and bang! Now of course i could link Curl as a dynamic lib, but i don't want to mess around with the settings. Anyway - having DllMain out of the static Irrlicht lib is the right thing to do; maybe someone else has problems with this together with other static libs.
Because we are talking about libs here - i have another "proposal":
- the dynamic Irrlicht lib should be named "libIrrlicht.dll.a" with the dll itself having the name "Irrlicht.dll" ( on Windows - i am not sure about naming conventions on Linux ).
- the static lib stays with it's present name "libIrrlicht.a".
This way we can build both without name clashes.
But this is not important right now - maybe something for Irrlicht 2.0.