-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
undefined reference to `PyCMethod_New' #3115
Comments
Without minimal example it is hard to tell, but I think that linking is source of your problem. Look at these two stacks: |
The same problem in my project, and I am working on a simple cast to reproduct this error. |
What was the issue @Keepmoving-ZXY ? I need to fix it in mine as well |
According to my memory, I solve this problem by changing another version of python. |
That and updating from Ubuntu 20.04 to 22.04, and updating pyside fixed it for me as well. Here was my changes (I did not test which was the culprit): |
Hi, I've solve the problem by update my Python interpreter version to
Notice |
In my case, the problem turned out to be that I used the In this mode, CMake will try to find the latest version of Python, even if it is not the first Python in your path. In this case, you will end up including headers from a newer Python whiling executing an older Python, and the older Python cannot link against symbols from the newer header. Setting |
My environment:
When I run compile a program use pybind11, it raise a error:
The text was updated successfully, but these errors were encountered: