I have a C++ library that provides various classes for managing data. I have the source code for the library. I am trying to call a function of lda.cpp of this library from python using ctypes. This function in turn uses function from all other .cpp files in the library.
//lda.cpp
#include "model.h"
#include <stdio.h>
#include "lda.h"
int lda_est(double alpha, double beta) {
model lda;
if (lda.model_est(alpha, beta)) {
return 1;
}
lda.estimate();
return 0;
}
What i found out is that i need to use C++ wrappers declaring the functions as extern and then compile them to a .so file. My question is how should i make this wrapper file? And should I declare all the functions in the library as extern or only the one that I want to call from python?