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

Using pybind with existing CMake structure #1217

Closed
JohnV7 opened this issue Dec 18, 2017 · 3 comments
Closed

Using pybind with existing CMake structure #1217

JohnV7 opened this issue Dec 18, 2017 · 3 comments

Comments

@JohnV7
Copy link

JohnV7 commented Dec 18, 2017

Issue description

I'm trying to use pybind with an existinc cmake structure. I modified the existing CMakeLists.txt file adding
add_subdirectory(src/pybind11)
pybind11_add_module(mycode src/mycode.cpp)
target_link_libraries(mycode PRIVATE ${MYCODE_LIBRARIES})

This compiles succesfully and generates mycode.so, but when trying to import it via python I get following error:
import mycode

ImportError: ./mycode.so: undefined symbol: PyInstanceMethod_Type

Any ideas what the problem may be?

@Xfel
Copy link

Xfel commented Dec 21, 2017

This might come from a python version mismatch between the version used to compile and the version used to run.

@henryiii
Copy link
Collaborator

Should be fixed by #2370 and related changes.

@me21
Copy link

me21 commented Feb 26, 2023

I have this issue with my setup.
I crosscompile on Windows for Beaglebone Black Linux ARM machine and I get this error when I try to import the .so file on the target.

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

4 participants