How do plugin systems work?

后端 未结 4 2060
半阙折子戏
半阙折子戏 2020-12-18 06:45

I\'m working on a project where I would find a basic plugin system useful. Essentially, I create the base class and can provide this base class to a plugin developer. Then t

4条回答
  •  执笔经年
    2020-12-18 07:35

    On Linux, a plugin is a shared library (with a .so extension) that provides one or more functions named in your plugin API. Your program opens the library with dlopen and gets pointers to the functions using dlsym and calls the functions using the pointers. The plugin can call any function that's exported publically from your program.

提交回复
热议问题