Writing a Windows VST3 plugin. I’m linking against some other 3rd-party libs: Google protobufs, Google RPC, and SuperpoweredSDK. Standalone app was working great, so I built the debug version of the .vst3. So far so good, it does load in the DAW.
But, as soon as I make any API call into any of the 3rd party libraries I’m using, the plugin segfaults. Memory seems to be completely corrupted, debugger is not giving me a backtrace when things die.
Could use some ideas to investigate. Current train of thought is maybe I’m doing something wrong when linking these libs into the dll or some sort of memory model issues? Tried to build with both /MD and /MT using the static and dynamic versions of the 3rd party libs, but that didn’t solve the issue.
Is there a place where I can upload a simple project to demonstrate this problem? I’ve tried linking 3 different libraries into the JUCE VST3 plugin, but in all cases the behaviour is the same – segfault when the DAW attempts to load the dll. Got a co-worker to build it on his machine with the same results. (But we’re both using VS2019, which makes me think maybe I should downgrade and try with an older version?)
I think linking libraries through a #pragma is a non-standard and not really cross-platform compatible way of linking a library – at least I’m not aware of widespread usage of this technique although MSVC++ seems to support it. However to make sure that this technique doesn’t generate any strange side-effects, have you tried linking the library the “old school” way through the appropriate fields in the Exporter Settings of the Projucer?
Yes, I tried both. My use of a #pragma here was to try and limit as much as I could the changes from a “standard” plugin (which works) to one that exhibited the crash behaviour.