Sunday, May 10, 2009

What are .dll files? Are these file get called in the linking process? In C printf() has its prototype in?

stdio.h. Where is the body of the printf()? Is it in the form of dll?

What are .dll files? Are these file get called in the linking process? In C printf() has its prototype in?
DLL = Dynamic Link Library. They do not get called in the linking process, but the equivalent .lib file does. A dll file may contain many functions called from many other programs. They exist to avoid having to have these functions statically linked with (many) programs and thus taking up space. For example, many win32 API functions exist in kernel32.dll.





As for printf, you'll find the body of these functions live in one or another msvcrtxx.dll (microsoft visual c runtime) files. Those are automagically referenced by the linker by means of the equivalent msvcrtxx.lib files, that contain info about the functions in the .dll. Those are used by the linker to resolve links, while the DLLs are used at runtime to provide code.


No comments:

Post a Comment