I have some C++ code, for which i have created a .so file.
My objective is to load this .so file in a python script.
In order to expose the C++ methods, i create a C wrapper method for them and expose the C method.
However, when trying to load the .so file in python script, it gives me an Undefined symbol error.
These errors are for methods that are used internally in some of the C++ classes and are not exposed out of the .so file. (nm -C -u .so)
- Aren't the names resolved when a .so file is created ?
- what is the best approach to resolve undefined symbols in .so file.
E.g. :
C++ :
class myclass {
public:
void func1(int _i);
int getval();
};
C wrapper :
extern "C" int getval_w();
int getval_w() {
myclass obj;
return obj.getval();
}
So, when i compile this code in a .so file and load that in a python script i get error like : Undefined symbol : "mangled name for func1"