On Linux you can dlopen() yourself and then call dlsym() to retrieve symbols, but the symbol names are not easily guessed due to C++ name mangling. It is far easier as well as more portable to just make a table which maps names to function addresses:
Code:
// A table of void functions which take single integers:
typedef void (*funcptr)(int);
struct func_map
{
const char *name;
funcptr func;
} functions[] =
{
{ "foobar", &foobar },
{ "asdf", &asdf },
{ "blah", &blah }
};
Then you need a function which looks through the array to find a match and returns the appropriate function pointer.
The problem is that each function pointer must be exactly the same type. If you need a more general method of passing functions around it is better to use templates and functors.