R
Ramon F Herrera
I have an app which dynamically loads lots of plugins (*.so files)
which contain Oracle stuff and are written in C. Being a recent C++
convert (huge fan!), I decided to add some modules written in C++.
Much to my surprise the dynamic loading fails, even for the simplest
of modules.
This is the relevant code:
handle = dlopen((mod_dir + "/" + filename).c_str(), RTLD_NOW); // This
succeeds
function = dlsym(handle, "function_name"); // This fails
Fortunately, there is a dlerror() function which allows me to diagnose
the 1st. statement above, but I don't know how to diagnose problems
with the 2nd. statement.
TIA,
-Ramon
ps: this is the C++ module that I have failed to load:
bool
abc(int)
{
int i = 123;
return true;
}
which contain Oracle stuff and are written in C. Being a recent C++
convert (huge fan!), I decided to add some modules written in C++.
Much to my surprise the dynamic loading fails, even for the simplest
of modules.
This is the relevant code:
handle = dlopen((mod_dir + "/" + filename).c_str(), RTLD_NOW); // This
succeeds
function = dlsym(handle, "function_name"); // This fails
Fortunately, there is a dlerror() function which allows me to diagnose
the 1st. statement above, but I don't know how to diagnose problems
with the 2nd. statement.
TIA,
-Ramon
ps: this is the C++ module that I have failed to load:
bool
abc(int)
{
int i = 123;
return true;
}