cppyy is a Python module for using C++ code inside python.
Questions tagged [cppyy]
59 questions
0
votes
0 answers
Typehinting custom collection class in dataclass
I have created a custom Python class, for use in dataclasses, that accepts python lists, but internally stores them as a C++ vector (interfaced with CERN ROOT). The type of what is stored in the vector is specified as a string during init.…
0
votes
1 answer
using nlohmann::json with cppyy?
Is it possible to pass a python dict into a function expecting a nlohmann::json (nlohmann/json) object via cppyy? This question has to have come up by now, but I wasn't able to find anything on it.
Minimal example to reproduce (without regard to…

Siraj Qazi
- 33
- 3
0
votes
0 answers
Segmentation Violation when passing pointer to base in CPPYY
The following code is a minimal example of this strange error.
The constructor of bar takes a pointer to the base class BaseFoo as argument.
When I tried to make a list of three BaseFoo pointers and create a Bar object for each of them, I get…

Max Wong
- 694
- 10
- 18
0
votes
1 answer
Calling C++ function from python with cppyy
I need to use cppyy to call functions from a 3rd-party C++ library in Python. To start I
wrote a simple C++ function and tried to load it in Python:
test.hpp
class Test {
public:
void test();
};
test.cpp
#include
#include…

Natanel Birarov
- 1
- 3
0
votes
0 answers
How to install python modules using cppyy?
I want to package a python module containing python source and a native c++ library. Cppyy is used to dynamically generate the bindings so the library is really just a normal library. The build system for the library is meson and should not be…

lweber
- 1
0
votes
1 answer
Where is the cppyy source code for pyhonizing STL vector, etc
cppyy does pythonizations for various C++ STL entities. Where in the cppyy source code are these pythonizations done? In particular, vector? I am hoping to find examples I can imitate

Edward C. Jones
- 25
- 2
0
votes
1 answer
Error with linking flag when using the cmake build for cppyy
I am trying to build the example for a make build for cppyy in the cppyy-knearestneighbors example (https://github.com/jclay/cppyy-knearestneighbors-example). From what I understand it used the more modern cppyy cmake.
However when it comes to the…

Eddie Shields
- 45
- 4
0
votes
1 answer
Read char16_t* String in user defined struct with cppyy from c++
According to this question: Read char16_t* String with cppyy from c++
I have a new problem with the char16_t* in a user defined struct.
Given a C++ function:
MLPI_API MLPIRESULT mlpiMotionGetConfiguredAxes(const MLPIHANDLE connection,…

araisch
- 1,727
- 4
- 15
0
votes
2 answers
Calling boost rtree from python
I am trying to adapt this boost rtree example so that python calls the c++ libraries. This is my first attempt at calling c++ from python. I am using cppyy 1.8.5 (python version 3.6.7) and boost rtree header-only library (boost version 1.58) on…

enkinpo
- 13
- 3
0
votes
1 answer
error: use of undeclared identifier 'LP_c_uint'
I am using cppyy in my project to call C APIs.
I get below error log captured by capfd plugin in pytest, when an exception happens:
input_line_33:2:11: error: use of undeclared identifier 'LP_c_uint'
(sizeof (LP_c_uint))
It is coming from below…

Rajat Verma
- 27
- 4
0
votes
0 answers
Unable to import cppyy in Pyhon
Although I have installed cppyy-cling, cppyy-backend, CPyCppyy and cppyy (in that order) using pip3 install, I am unable to do a basic import of cppyy from the Python3 prompt.
Python 3.6.9 (default, Oct 8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type…
user13477493
0
votes
1 answer
Pointer Variable raise error as unknown type when using cppyy in python
So I have this sdk and here is the documentation which is in c++ which so I installed cppyy but when I include the header file with cppyy in python it raises error
// MysticLight_SDK.h : header file
//
#pragma once
typedef int…

sarfaraz saleem
- 45
- 8
-1
votes
1 answer
Are unreadable error messages form CGAL or cppyy?
I have trying to wrap a small part of CGAL (Computational Geometry
Algorithms Library) using cppyy. I get completely unreadable error messages. Are these messages just being passed through from CGAL?
Here is one of the messages. I have chopped…

Edward C. Jones
- 25
- 2
-1
votes
1 answer
In conda environment, "include cppyy" in python causes a seg fault
I am working in a anaconda environment use cppyy. For a few hours I have been getting segfaults when I import cppyy into python:
(CPPYY) > python
Python 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46)
[GCC 9.4.0] on linux
Type…

Edward C. Jones
- 25
- 2