You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have imported my pybind11 include path on xcode field Header Search Paths.
Now I Have 2 classes called MainComponent.h and MainComponent.cpp.
If I Include pybind writing in my MainComponent.h#include <pybind11/embed.h> , xcode rise a warning in file common.h (file contained in pybind11/include/detail) saing file not found near line #include <Python.h>, to fix it tried to change this line (I don't want obviously to change pybind11 source code, but to understand the problems I tried to do it) in #include <Python/Python.h>
Trying compiling again the same warning raised near line #include <frameobject.h>, so I changed it in #include <Python/frameobject.h>.
Finally trying to build it again the same warning raised near #include <pythread.h> and I changed it in #include <Python/pythread.h>
At this point I launched my application without any other line of code added if not #include <pybind11/embed.h> in my MainComponent.h and it works. So, FIRST QUESTION: why this? there's no other way to setup things better?
SECOND PROBLEM:
After all this (trying to follow pybind11 documentation) if i write in my .cpp (not in .h because it is included in more than one other modules) this code below and 97 warnings are raised telling me things like "Undefined symbol: _PyBaseObject_Type" or "Undefined symbol: _PyCFunction_NewEx" (I add in attachment an export with all warnings raised):
int add(int i, int j) { return i + j; }
PYBIND11_MODULE(example, m)
{
m.doc() = "pybind11 example plugin";
m.def("add", &add, "A function which adds two numbers");
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I have imported my pybind11 include path on xcode field Header Search Paths.
Now I Have 2 classes called MainComponent.h and MainComponent.cpp.
If I Include pybind writing in my MainComponent.h #include <pybind11/embed.h> , xcode rise a warning in file common.h (file contained in pybind11/include/detail) saing file not found near line #include <Python.h>, to fix it tried to change this line (I don't want obviously to change pybind11 source code, but to understand the problems I tried to do it) in #include <Python/Python.h>
Trying compiling again the same warning raised near line #include <frameobject.h>, so I changed it in #include <Python/frameobject.h>.
Finally trying to build it again the same warning raised near #include <pythread.h> and I changed it in #include <Python/pythread.h>
At this point I launched my application without any other line of code added if not #include <pybind11/embed.h> in my MainComponent.h and it works. So, FIRST QUESTION: why this? there's no other way to setup things better?
SECOND PROBLEM:
After all this (trying to follow pybind11 documentation) if i write in my .cpp (not in .h because it is included in more than one other modules) this code below and 97 warnings are raised telling me things like "Undefined symbol: _PyBaseObject_Type" or "Undefined symbol: _PyCFunction_NewEx" (I add in attachment an export with all warnings raised):
Build target NewProject - App_2021-12-12T19-03-51.txt
}
Beta Was this translation helpful? Give feedback.
All reactions