I am writing a win32 VST-plugin, originally generated with the Jucer(experimental). I’ll call it “MyVst” in this post…
Among other things, it is linked statically with “Security.lib” (a security tool library provided by my company, which I am obviously bound to use, and upon which
I have almost no control…) Security.lib is compiled with the /MD (/MDd in Debug…) command line option (that means, linked dynamically with the CRT)
Jucer’s generated projects use statically linked CRT by default (/MT and /MTd), but it turns out it won’t link properly this way. MyVst complains about hundreds of error LNK2005 (basically : “Some stuff in MyVst is already defined in Security.lib. I’m a stupid linker that doesn’t know how to deal with it…”)
Ignoring the specific CRT libraries that the linker complains about (typically libcmt[d].lib, msvcrt[d].lib) doesn’t help : I get LNK2001 instead (“Boooh, I can’t find the definition of some stuff…”)
So, I thought I might just as well change MyVst’s settings to /MD (/MDd in debug). After all, this vst is never going to be released without the security suite that includes the DLLs for the CRT anyway, so it’ll just reduce the size of my dll, which is fine, as far as I am concerned… I did so, it compiled and linked all right, but at runtime, only the Debug version is working. The Release version has different odd behaviours, depending on the VST-Host I try to load MyVst.dll in…
Looking at the MyVst.dll (the release version) with Dependency Walker shows it can’t find MSVCP90.dll…
I tried MyVst_dbg.dll (the functionnal debug version) with DependencyWalker, for comparison. He says it’s ok : MyVst does need MSVSP90D.dll (the corresponding debug version) but he’s happy, he knows where it is : deep down in some C:\windows\winsxs… subfolder. And just in the neighbour folder, with basically the same name except it hasn’t “debug” in it, guess who I found ? MSVCP90.dll : the mysterious dll that Dependency walker, and presumably all my VSTHosts, weren’t able to find for the release version.
I’ve also been checking my projects settings, looking for differences between Debug and Release configurations, but I could spot nothing suspicious (probably because I don’t really know what I am looking for anyway…) Only thing maybe worth mentioning : in debug, the Jucer wants to ignore libcmt.lib and msvcrt.lib, and there’s nothing corresponding in release configuration. It seemed odd to me : why would I want to specifically ignore release-library in debug mode ? Nobody is going to try to link on them anyway. (And removing it doesn’t seem to change anything, btw, and didn’t solve my problem…)
So, I don’t really know what to try next… Any help would be welcome !
(And just in case : Win32, Visual C++ 2008, Juce 1.52…)