This is an interview question.
Is it possible to link lib dynamically, like a DLL?
For example, for a DLL we use LoadLibrary and call the exported functions. Is it possible to use the lib file in the same way?
No. .liblibrary statically linked and it is the goal to resolve symbol names link-time Linker , and his exile to the execution time . They are often called "static libraries" (so I added this tag to your question!). This is a short lib story.
.lib
DLL, .
. DLL , , .lib DLL-.
. . DLL - PE32 , . LIB - OBJ.
, , , DLL , . , .LIB , .
, , DLL. DLL, , ++ . , .
. .LIB, . , , malloc-stlye, , EXPORT. , EXPORT, .
Yes - not directly, but with very little work.
Create a new .DLL project, connect the .lib, determine which functions you want to export in the .DEF file, and then compile.
Source: https://habr.com/ru/post/1789964/More articles:Distributing my Mac app to friends - objective-cError configuring geoip on django - djangoFailure representing modal view controller - iphoneThe width of the table is 100%. 1 fixed column width - cssError in jQuery - javascriptOpen external PDF file in asp.net MVC 2 - c #Code Assist, OpenGL VAO / VBO Classes are not drawings - c ++Is it possible to get the result of sending SMS from another activity? - androidadd a new column for a special price in the grid in the admin panel in magento - phpWPF Icon ContextMenu Disable Item - wpfAll Articles