Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

fix compilation and linking with pyimgui #1

Merged
merged 1 commit into from
Mar 25, 2021
Merged

fix compilation and linking with pyimgui #1

merged 1 commit into from
Mar 25, 2021

Conversation

KinoxKlark
Copy link

Hey, as a follow-up of the conversation in KinoxKlark/pyimgui#2 here is my fixes.

You don't have to copy the core.pxd from imgui, my bad. You only need to have the imgui module installed or accessible. In my quick toy exemple, I had to copy the lib (.pyd or .so) since I didn't install the module but when compiling pyimgui it is automatically installed on your environment for convenience. Thus it is not even necessary to copy anything from pyimgui.

I had to include config-cpp/ for compilation.

cimport is on imgui.core not core (this would be implot.core)

With theses changes I can compile and I get:

>>> import implot
>>> import imgui
>>> ctx = imgui.create_context()
>>> _ = implot.create_context()
>>> implot.set_imgui_context(ctx)

Without any errors!

@hinxx hinxx merged commit 735cec0 into hinxx:main Mar 25, 2021
@hinxx
Copy link
Owner

hinxx commented Mar 25, 2021

This works! Thank you very much! 🥳

cimport is on imgui.core not core (this would be implot.core)

So this actually makes sure that the *.so is loaded from the original place, avoids copying and solves the:

TypeError: Argument 'ctx' has incorrect type (expected imgui.core._ImGuiContext, got imgui.core._ImGuiContext)

Subtle 🤕

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

Successfully merging this pull request may close these issues.

2 participants