Indirect DLL loading conflict

Started by
3 comments, last by Nyarlath 11 years, 7 months ago
Dear all,
I am developing an application A which links to third party libraries B (B1.lib and B1.dll) and C (C.lib, C.dll and B2.dll). B1 and B2 are different versions of the same library and export functions with the same names.
The project compiles, links and starts, but I get runtime errors when I call functions declared in C. If I replace B1.dll with a copy of B2.dll (to verify that the wrong dll is being used), the calls of C are working, but obviously I get into trouble when I call functions of B1 directly.

Why is C using B1 when it has been compiled linking to B2? Is there a way to force C to call the functions of B2 instead of B1?

Many thanks
Advertisement
Do B1.dll and B2.dll share the same file name?

Do B1.dll and B2.dll share the same file name?

No, they could not even, because they have to be located in the same folder as the application. If B2 is missing, the application refuse to start.
(This is puzzling me because renaming the libs was the panacea of dll problems.)
Am I right when I suspect that when calling something in C you hand it something you created directly through B1?

Am I right when I suspect that when calling something in C you hand it something you created directly through B1?

No, they are called from unrelated code.

Looking at the modules loaded I have verified that both of the libraries are loaded, so I am now convinced that it is not a library loading problem, but a conflict between the two versions running in parallel. This is possible if they share some resources somewhere.

Many thanks for your interest.

This topic is closed to new replies.

Advertisement