3rd party library also contains DllMain ; Link Error

Hey yall,

I’m trying to use a library called assimp with juce. Assimp uses another library called Irrlicht.lib which apparently also contains a definition for DllMain. When trying to link statically, I get a link error.

I’m really not sure how to go about solving this as renaming either of the definitions seems like a terrible idea. Would appreciate any input and possible solutions!

Edit: I should clarify, I’m not really sure how to go about solving this because I never directly use Irrlicht. Somewhere along the way assimp is using it, which is why I don’t think renaming things is a solution.

Does the DllMain in the irrlicht.lib appear to be doing anything important? Like the name says, it’s a function for DLLs to do some stuff when the DLL is loaded and unloaded. As far as I recall, static libraries shouldn’t even have that. Maybe it’s an error in how the irrlicht.lib is built? Is the irrlicht.lib used actually the kind of .lib file that loads irrlicht.dll and not really a static library that has the actual code for the library?

Hmm, I double checked to make it was the actual static library, but after doing some googling I think you’re on to something. I just used vcpkg to build/install assimp/irrlicht statically, but it seems they have some funky build instructions to make a static build so something probably went wrong along the way.

Guess I’m gonna try to rebuild them with Cmake and the extra steps and see if that fixes anything.

Final update:

After a lot of trial and error, I got the static library built with CMake and the custom settings which did infact fix the problem. Thanks again :slight_smile:

1 Like