I’m working on a custom C++ CHOP and would like some help figuring out why the plugin fails to load.
I’ve successfully copied the C++ CHOP sample, and can get it to compile and load into TouchDesigner with a CPlusPlus CHOP.
I’ve successfully got it including (but not using) a 3rd party (sprawling) library. So the linking is all working.
My plugin compiles, and I can do some simple openCV stuff, so confident that part is working.
When I add any code that instances a class from the included 3rd party library, I get an error when loading the dll in TouchDesigner that just says “Failed to load the plugin”.
I’m pretty sure it’s to do with a mix of C/C++ and different versions of C++ or MVSC but without any further debugging info it’s kinda hard to figure out what’s going on.
For reference, the C++ library I want to include requires C++ 17 or higher to compile. I noticed if I compile the vanilla CPlusPlus sample plugin with C++ 20 Language Standard I get the same “Failed to load the plugin” error.
If I compile the vanilla CPlusPlus sample plugin with C++ 17 Language Standard, it loads and works fine.
If I compile my plugin with “ISO C++17 Standard (/std:c++17)” it will load, and the includes will work, but as soon as I add anything to my plugin that uses a class in the third party C++ library and recompile - I get a “failed to load the plugin” error from TD. As the plugin doesn’t even load, I don’t get any debug out to find out what the issue is.
The sprawling third party plugin was compiled with VS 2019 v142, and I’ve also set my project to that. (also tried v143 but same issue).
Any thoughts on how I can get debug info from TD to see why the plugin is failing to load and/or likely causes/solutions to this?