I have an executable and a dynamic library (.so). The library exports some symbols and executable calls it successfully. But I want to make possible to library call executable's functions. I've tried to do following in executable:
//test
extern "C" void print(const char * str) {
std::cout << str << std::endl;
}
and this in library:
extern "C" void print(const char *);
but when i call dlopen
in executable (to load the library) it returns error undefined symbol: print
. how can i fix it?