Renoise 2.8 doesn't see my Mingw-built plugin [SOLVED]

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

This is a 2.4 plugin. I'm using Mingw because f**k all those gigabytes of VS bloat.

Dependency Walker does see my exported VSTPluginMain.

I read that I shouldn't be using __declspec(dllexport) on my VSTPluginMain because it puts decoration on the symbol. Does Dependency Walker strip off the decoration in the symbol table it shows? Because I don't see any.

So maybe I'm supposed to be using a .def file instead of __declspec. But *how*? I see in documentation all over the place that it's useful, but even the man pages for ld and g++ gloss over how you actually give the .def in the command line options. It's like it's some magic knowledge you're supposed to be born with.

Or maybe Renoise is actually finding my VSTPluginMain and it's returning junk. But gdb isn't helping. I attach to Renoise, do "dll-symbols myplugin.dll", but when I go to list the function to make sure the code lines are in there, I get nothing. And if I forge ahead and do "break VSTPluginMain" anyway, then continue execution, I get a memory access error. Like the function entry point isn't actually where gdb thinks it's supposed to be. Then if I do "break vstplugmain.cpp:VSTPluginMain", continue, and rescan the plugin directory from Renoise, nothing happens. No break.

Renoise loads other plugins just fine.

Help please?
Last edited by MackTuesday on Thu Jul 02, 2020 10:07 pm, edited 1 time in total.

Post

I have been using a .def file with the following contents and the plugin loads fine in Renoise 3
EXPORTS
VSTPluginMain
main=VSTPluginMain
Does it show up in other hosts? The "trick" of also exporting a main function is something I read on kvr IIRC and for compatibility reasons, some hosts look for other entry functions.

Post

Hey thanks for your input. I tried this and checked in Dependency Walker that both VSTPluginMain and main are exported, but Renoise still doesn't see my plugin.

Other hosts also have trouble with it.

What does your link command look like? Mine's like this:

Code: Select all

g++ -shared -mwindows myplug.def <bunch of .o files> -o myplug.dll
Does anyone know of tools that will help me figure out what the exact problem is?

Post

The minihost code that comes with the 2.4 SDK *does* successfully see and load my plugin! But other hosts don't!

Post

I build with MSVC and use CMake to create all the build and link commands, so I don't write them manually, but basically I just add the .def file to the list of sources if building for Windows.

I do recall having issues with the plugin not showing up in hosts before adding the .def file, but I can't recall exactly what the issue was. I do remember using dumpbin to check a couple of working plugin to see what functions they exported. Sorry for not being more precise, but do a search on "VSTPlugMain" in this subforum and see what you come up with if you haven't already.

Post

Solution: I tried loading my plugin into Ardour. It told me the file libgcc_s_dw2-1.dll was missing. This meant I needed to link in the gcc runtime stuff explicitly. Maybe I should have known that already. Oh well.

So I added -static-libgcc and -static-libstdc++ flags to my link step. Now it works!

Dependency Walker gave me a red flag that might have eased my trouble, but I didn't see it for what it was because another successfully loading plugin had the same effect. The red flag was an error (in addition to the warning that all plugins produced) along the lines of a missing dependency. Most plugin files didn't have this.

Post

You can also use -static for all stuff. Usually it results in better optimization.

Post

MackTuesday wrote: Thu Jul 02, 2020 10:15 pm Solution: I tried loading my plugin into Ardour. It told me the file libgcc_s_dw2-1.dll was missing. This meant I needed to link in the gcc runtime stuff explicitly. Maybe I should have known that already. Oh well.

So I added -static-libgcc and -static-libstdc++ flags to my link step. Now it works!
:tu: Nice to hear, so the problem was likely never that the Renoise couldn't find it, but the lack of error messages when scanning it. Now that you mention it, I think I've run into similar issues and had a hard time tracking them down because of the lack of error messages from the host.

Post

MackTuesday wrote: Thu Jul 02, 2020 10:15 pm Dependency Walker gave me a red flag that might have eased my trouble, but I didn't see it for what it was because another successfully loading plugin had the same effect. The red flag was an error (in addition to the warning that all plugins produced) along the lines of a missing dependency. Most plugin files didn't have this.
You kinda really have to look at where the "red" comes from, because at least for me depends.exe always shows some "red" for everything, because of some (irrelevant) demand loading shenigans in standard Windows DLLs, where it can't find some files that won't actually ever be needed anyway... yet at the same time, it does show up valid problems as well, just the color "red" alone isn't helpful except as a filter for "go through these and see if any of them are a problem." :)

Post Reply

Return to “DSP and Plugin Development”