How to call dynamic library function from c++?
问题 Currently I'm creating some sort of plugin system. My program writes the code, which is then compiled (see also my other question). The resulting (compiled) library is than opened again using dlopen . This allows people to program custom functions in the program themselves. //Open the compiled library at the specified path void* handle = dlopen("COMPILEDLIBRARYPATH", RTLD_LAZY); if (handle == NULL) { std::cout << "plugin not found" << std::endl; } //Find the function pointer and cast is to