I'm supporting a Linux program that allows users to write their own .so file based plugins that are loaded at runtime with dlopen(). Sometimes a user will forget to include a C++ file in the makefile that contains necessary function definitions. When the plugin manager uses dlsym() to load an exported function from the plugin that depends on one of these missing function definitions, I get a null function address.
My question: How can I detect this error ahead of time? I've tried the -z defs and -Wno-undef linker flags, but they don't generate an error. I've tried the nm, readelf, and objdump commands with various flags but the undefined functions don't show up in the symbol tables at all. Any suggestions? Thanks!