Creating a module system (dynamic loading) in C

前端 未结 9 1946
故里飘歌
故里飘歌 2020-12-12 12:53

How would one go about loading compiled C code at run time, and then calling functions within it? Not like simply calling exec().

EDIT: The the program loading the

9条回答
  •  失恋的感觉
    2020-12-12 13:31

    If you are willing to consider the framework, Qt provides QPluginLoader: Qt 5 docs (or for old Qt 4.8 docs see here)

    If you need/want more fine grained control, Qt also provides a means to load libraries on the fly with QLibrary: Qt 5 docs (or for old Qt 4.8 docs see here)

    Even better, these are portable across platforms.

提交回复
热议问题