Good patterns for a C/C++ plugin-based system?

前端 未结 5 1574
-上瘾入骨i
-上瘾入骨i 2020-12-08 03:48

When developing a C/C++ (=2?) plugin based framework with shared objects/dynamic libraries that need to support live swapping what examples would be helpful to look at for i

5条回答
  •  醉话见心
    2020-12-08 04:32

    If you are on POSIX, dlopen(), dlsym() and dlclose() are all you need.

    See man dlsym for details and examples.

    There is a good article about loading dynamic libraries, and plugin infrastructure is an example.

    EDIT OP added Windows as requirement so this approach won't help since Windows isn't POSIX-compliant. However there are similar functions in WinAPI - see here.

提交回复
热议问题