Creating a module system (dynamic loading) in C

前端 未结 9 1955
故里飘歌
故里飘歌 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:48

    In Linux/UNIX you can use the POSIX dlopen / dlsym / dlerror / dlclose functions to dynamically open shared libraries and access the symbols (including functions) they provide, see the man page for details.

提交回复
热议问题