I have to write a c program, that gets a .so file (shared-object) as an argument in the main method and call a function f on it. It expects a function f to exist on this library. My program has to work for any .so file, so I can't include them directly.
so by calling
./myprogram myLibrary.so
myprogram has to do something like this:
int main(int argc, char *argv[]) {
return argv[1].f();
}
How can I achieve this and what else do I have to consider when compiling my code?