I want to embed a Python interpreter within my C++ application, and make them call each other. I followed the sample in the official doc of pybind11, and now I can call a Python sub-program and create a object of python's class in the main program of c++, But my python class need to derive from a c++ base class.
Although there is a official sample about deriving a C++ base class within Python, but it is extending python with a C++ module(in form of *.so file), not embedding a Python interpreter into a C++ application.
There will NOT a shared library (*.so) file in my projects, if I import myCppModule in Python, where would it find the module? How should I offer the module in C++?
If I blindly make a *.so file as a module for Python, may I encounter a linking conflict? Because there will be two binary code copies of my base class, one copy resides in main executable, and the other reside in the shared library.