1,348 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
60
views
How is the rvalue_from_python_stage1_data convertible pointer is deallocated in boost python
Question
Can you provide some insight what is the role of the rvalue_from_python_stage1_data convertible pointer and how is being deallocated (memory managed) in boost python?
Background
According to ...
2
votes
1
answer
59
views
boost::python pointer to Base class extraction fail
I created a program that exposes class with virtual function to python using boost::python. Also I configured everything so that I could load python module that was created by boost::python and ...
2
votes
0
answers
50
views
boost::python - Export Custom Exception (2nd edition)
Based on Boost 1.88.0, boost::python Export Custom Exception and linked discussions I'm using the following to expose a custom C++ std::exception to python.
class cException : public std::exception
{
...
0
votes
1
answer
88
views
How to avoid defining a wrapper for abstract base class if I only expose derived classes to python but still use the base class non virtual methods?
Given this class
class ABC {
const std::string& getid() const;
/// other pure virtual methods
};
class D1 : public ABC {
/// override and implement virtual methods
};
class D2 : public ...
0
votes
0
answers
52
views
boost:python expose const std::string& [duplicate]
I understand std::string is exposed to python by implicit converters that don't need to be registered.
However, const std::string& isn't
I have
class Cal {
const std::string& get_name() ...
0
votes
0
answers
87
views
Allocating Mutex in a Python Module Developed with C++
I want to create a C++ library that will support both C++-based and Python-based applications running on Windows 10. The C++ application is multi-threaded, so I protect critical sections in my library ...
1
vote
1
answer
109
views
How do I initialize python when running a program as a service in Windows?
I am creating a service based on SFL (Service Framework Library). When I work from the console, it is okay, but when I run it as a service, via "sc start MyService", it issues fatal errors ...
0
votes
0
answers
88
views
Using the Boost library to include a C++ program in python with Python.h, bjam not found
I have code in C++ that performs multiple mathematical equations. When doing it with Python, it takes a long time (about 5 minutes), and when running it in C++, it takes about 10 seconds. I want to ...
0
votes
0
answers
54
views
CMake target_link_libraries for boost-python is the variable ${PYTHON_LIBRARIES} needed?
I am following Advanced C++ / Python integration with Boost.Python tutorial to get a get a grasp on Boost-Python lib.
In the example above I have:
hello.cpp :
#include <boost/python.hpp>
#...
1
vote
1
answer
77
views
Use Boost python with libtorch
I am trying to create a python package from C++ code with Boost python. However when including libtorchin the code, the resulting python package shows strange errors such as
Boost.Python....
1
vote
0
answers
46
views
Pass std::map to python as a parameter [duplicate]
I have the following C++ code:
const std::string Get(const std::map<std::string, std::string> map) {
PyObject* module = PyImport_ImportModule("dummy");
boost::python::dict ...
1
vote
1
answer
75
views
Beast Socket from Boost Python Package Kills Jupyter Kernel
For some reason when exposing the below to python using Boost Python, the unique pointer constructor (the obj constructor) fails. This used to work for me before, not sure why it stopped.
#pragma once
...
0
votes
0
answers
92
views
Visual Studio 2022 not creating DLL using Boost.Python
After following this page on how to install boost in Visual Studio 2022, I added the hello world for Boost.Python into the main.cpp file. However, even though the program builds and runs successfully, ...
0
votes
0
answers
52
views
Is it safe to define static python object in C++ for Boost.Python?
I have a python script that calls some C++ code, and in the C++ part, I want to define some static python object, for example: static boost::python::list obj. However, according to pybind11 issue 1598 ...
0
votes
1
answer
203
views
Unable to install py3exiv2 in python on a MacBookPro
pip3 install py3exiv2 gives error:
In file included from src/exiv2wrapper.cpp:27:
src/exiv2wrapper.hpp:33:10: fatal error: 'exiv2/exiv2.hpp' file not found
33 | #include "exiv2/...