Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntryPointNotFoundException when creating a ImPlotPoint #24

Open
Cidolfas opened this issue Dec 6, 2023 · 1 comment
Open

EntryPointNotFoundException when creating a ImPlotPoint #24

Cidolfas opened this issue Dec 6, 2023 · 1 comment

Comments

@Cidolfas
Copy link

Cidolfas commented Dec 6, 2023

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:

System.EntryPointNotFoundException: Unable to find an entry point named '??0ImPlotPoint@@QEAA@NN@Z' in DLL 'implot'.
   at DearImPlot.ImPlotPoint.__Internal64.ctor(IntPtr __instance, Double _x, Double _y)
   at DearImPlot.ImPlotPoint..ctor(Double _x, Double _y) in /_/DearImPlot/ImPlot.g.cs:line 1129
   at SampleApplication.OpenTK.MyGameWindow.OnRenderFrame(FrameEventArgs args) in W:\test\DearImGui\SampleApplication.OpenTK\MyGameWindow.cs:line 67
   at OpenTK.Windowing.Desktop.GameWindow.DispatchRenderFrame()
   at OpenTK.Windowing.Desktop.GameWindow.Run()
   at SampleApplication.OpenTK.Program.Main(String[] args) in W:\test\DearImGui\SampleApplication.OpenTK\Program.cs:line 38

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.

@Cidolfas
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant