开发者

Project contains more lib than dll files

开发者 https://www.devze.com 2023-03-23 17:51 出处:网络
I try to understand a visual studio project, which I had downloaded. 开发者_开发百科There are two folders a bin and a lib folder. The number of lib files in the lib folder is greater than the number o

I try to understand a visual studio project, which I had downloaded. 开发者_开发百科There are two folders a bin and a lib folder. The number of lib files in the lib folder is greater than the number of dlls in the bin folder.

I thought every dll file could have a lib file (object file library). So the number of lib files in a project is equal or lower than the number of dlls. But in the downloaded project its the other way round?! Whats the reason for that? Are some of the lib files are kind of statically linked?

Thank you very much for you're help.


Of course there are lib's that don't have a corresponding dll. If you set your project type to "static library" your output will be a lib file which can link only statically to another lib, dll, or exe.

When you create a dll, a lib file is automatically created which takes responsibility of conveniently wrapping LoadLibrary and GetProcAddress calls. You link statically to this lib and it loads the dll for you.


libs without a dll are statically linked into the exe at compile time whereas dlls are compiled into their own dll file. dlls are often best to allow the dlls to be compiled and swapped out without replacing the exe. However, some projects have only statically linked libs which results in a single larger exe with no dlls.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号