Open Spacechild1 opened 4 years ago
Please, describe the problem and give further information.
Ah, sorry, should have been more specific. The Windows binaries export all symbols from the statically linked libpd. Generally, a VST plugin should only export its entry points.
Ok, so it is a Windows-specific issue. I guess this is because the EXTERN macro is defined as __declspec(dllexport) extern
. I should change that...
Did you encounter any incompatibility?
Perhaps this is a dumb question but as these symbols are exported, I guess the plugin could load externals... It would be great if you could try ;)
Did you encounter any incompatibility?
Not really, but hiding symbols never hurts :-) But it's more of an issue on Linux than on Windows.
I guess the plugin could load externals...
that's true! Do I have to compile externals with PDINSTANCE? On Windows, this should actually work, I might give it a try. I guess on Linux you would have to dlopen externals with RTLD_DEEPBIND in case someone else already exported the Pd symbols. I already use RTLD_DEEPBIND in [vstplugin~], because otherwise Camomile would take the symbols from the Pd executable instead of the statically linked libpd, so for loading externals you would have to do the same. Unless we say that loading Camomile in Pd is a bad idea in the first place, but actually it was Miller himself who needed this for a project.
I think the fundamental problem is that Pd externals link against pd.dll and try to find/load a module of that name. At the moment I see two solutions:
1) Camomile links dynamically and ships libpd.dll (which all externals for Camomile can link against) 2) for every Camomile plugin, you have to link all externals against the plugin (instead of pd.dll)
I tried 2) and at least it didn't crash but I don't think my external actually loaded. Unfortunately, Camomile doesn't give me any console printout, so it's hard to tell where it fails. When I have more time, I can change the code so I can see the error messages.
Camomile doesn't give me any console printout
The console is accessible by clicking on the top left flower. You can also define the warning level like in Pd.
ha, cool! it can find my external but can't load it. Now I need to do some printf debugging to find the reason.
Yes I think externals must be compiled with PDINSTANCE. I will check all the definitions used by Camomile. I still don’t have a windows machine so it’s difficult for me to work for windows specific issues :(
The plugins should only export their entry points.