[C++-sig] Beginner - How to extract a Python Class that inherits from C++ Class

2020-05-12 Thread Carlos Duran via Cplusplus-sig
Hi, I was being researching the Boost.Python library, this archive and stackoverflow but I couldn't find the correct answer. I tried the following: -First: I created the C++ Class. -- user@host ~/ProjectFolder: cat lib

Re: [C++-sig] Cplusplus-sig Digest, Vol 125, Issue 3

2020-05-13 Thread Carlos Duran via Cplusplus-sig
Hello again, I rewrite part of the code, but I didn't find my error. My new code is: cat ../src/DemiWu.cpp #include #include #include #include #include using namespace boost::python; using namespace DemiWu; #if PY_MAJOR_VERSION >= 3 #   define INIT_MODULE PyInit_DemiWu   

Re: [C++-sig] Cplusplus-sig Digest, Vol 125, Issue 5

2020-05-14 Thread Carlos Duran via Cplusplus-sig
Hi, I tried that solutions but they didn't work, furthermore, I thought that polymorphisim only works on pointers. I also tried changing to reference(Component&) and adding a HeldType in the import module: class_*/, boost::noncopyable>("Component", init<>()) but all of this is futile.

Re: [C++-sig] Beginner - How to extract a Python Class that inherits from C++ Class

2020-05-16 Thread Carlos Duran via Cplusplus-sig
Hi, I find the solution, first of all I need to add the initializer on the C++ class import:     class_, boost::noncopyable>("Component", init<>())   // I additionally added a Holder, but is not necessary. Then I add the base class initializer on the python class:   c

[C++-sig] Beginner How to debug a python class extracted in C++

2020-05-16 Thread Carlos Duran via Cplusplus-sig
Hi, I recently started a Boost Python project, https://mail.python.org/pipermail/cplusplus-sig/2020-May/017585.html but I need to debug my python classes extracted in C++ in the main program. The only referece that I find to this topic is in https://www.boost.org/doc/libs/1_73_0/libs/python/doc