Open Cidolfas opened 11 months ago
I dug into this a bit, and it looks like the issue is simply that ImPlot doesn't add IMPLOT_API onto the constructors of ImPlotPoint or any of it's other structs - so the resulting DLL doesn't have those functions in its exports.
Without the macro, only the zero-argument constructor works (though I haven't tested if trying to use that object as input to an ImPlot function would cause a crash, so for all I know that won't correctly marshall back to the c++ side)
If I slap the API macro onto those, they all work without the exception. I'm going to put an issue in on the IMPLOT repo asking about why those functions don't have the macro on them.
It likely also means this project has a similar issue with the other structs used by IMPLOT - and their member functions like ImPlotRect::Min.
One other issue I've found that can't be fixed as easily (and probably also has a similar issue on the imgui side, which does have the IMGUI_API macro on its struct constructors/functions) are the copy constructors. Since they're not explicitly defined in the imgui/implot libraries but are picked up by this tool's generator code, trying to invoke the ImPlotPoint(ImPlotPoint _0) constructor has the same "calling a function that's not on the dll's export list" exception. I don't see an easy way to fix that one.
I had this issue in my own project, so I tired it inside the sample project and got the same exception.
I pulled the v1.89.3 branch, ran the build script, ran the sample app to make sure it worked, and then added the line
ImPlotPoint test = new ImPlotPoint(0, 0);
to the top of the MyGameWindow::OnRenderFrame function. I get the same exception if I try to use the constructor that wants a Vector2 instead.The sample app then gets the EntryPointNotFoundException every time.
Here's the full exception:
I don't have any issues getting an ImPlotPoint instance in C# if I call a function that returns one - like ImPlot.PixelsToPlot - so I'm at a loss for how to help dig further.