Home > Back-end >  Unix dynamic libraries and header files
Unix dynamic libraries and header files

Time:11-28

During the compilation of the main program,
1. Instead of introducing the header file, the main program and the introduction of dynamic libraries at compile time so
2. Introduction of header files, compile time compilation, together with the file without introducing dynamic library
Is there any difference between both, at the time of execution will,
Or a great god, help solve, header files and dynamic reservoir don't...

CodePudding user response:

1 main program didn't introduce the header file, the program is to use dlopen, dlsym way to invoke dynamic repository so? If this is the case, so it is not necessary to specified at compile time, the main program will run to dlopen load link library
2 introduced a header file and specify the link library compiled together, this way, the main program with dynamic loading when link library

Your so-called is refers to the right, the execution of the difference between the former link libraries in can be used to load so, which is in the main program with dynamic link library loading so
  • Related