gerval.blogg.se

Swig software wrapper
Swig software wrapper









swig software wrapper

The errors you get from this process may not seem simple. SWIG can generate a enormous wrapper file that is almost unreadable and then you need to compile it. I found this part to be the most confusing and difficult. Note: to be able to use std::string properly you need to include the interface file for the class (std_string.i).This interface file includes both the header files for the methods and class(es) I want to be able to use in Python. * Put header files here or function declarations like below */

swig software wrapper

In the file you should include all of the methods/attributes/variables/header file you want to be exported. There are some global methods, some global variables and a class that uses a non C-like class std::string.Īn interface file is kind of like a header file but to be used specifically by swig. I am going to want to wrap far more complex data types and classes. There is a short tutorial on this page which covers some of the basics, however this is not enough. In order to be able to access the C++ code from Python (or other languages) I have wrapped some of the functionality using SWIG ( Simple Wrapper Interface Generator).











Swig software wrapper