Re: Relationship.....




"Jawad Rehman" <jawadsmail@xxxxxxxxx> a écrit dans le message de news:
1159294155.539599.153730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi...

What is relation b/w #include<windows.h> or etc directive,
the dll files which are linked with compilers.iam using visual studio
visual C++ IDE.
e.g

project ->settings->Link Tab...
Here we have gdi32.dll,kernal32.dll etc.

and our program code.

When you #include a header file, it's content is put in place of the
#include by the preprocessor, so what the compiler really see is the
concatenation of all the #included headers and the source file.
Now, the headers just contains *declarations* of functions. The declaration
just says "there is somewhere a function named XXX wich has this specific
signature". This allows the compiler to generate code that can *call* those
functions.

Now, the *body* (ie, the actual implementation code) of the functions need
to be somewhere : it is either in your code for the functions you write
yourself, either in libraries (kernel32.lib, gdi32.lib) for system-defined
functions. Those are what you feed the linker with.
Actually, libraries can be either static or dynamic.
- Static libraries are big .lib files which contains actual binary code. The
linker copies the necessary code inside your exe when building it.
- Dynamic libraries are a pair of a .lib and .dll files. The binary code is
in the dll file (which must be present on the target system for the program
to run), while the.lib file is just a stub which indicates to the linker
that the implementation should be looked for in a DLL, at runtime (and not a
link time - which is why this process is somtime called "late binding").

Arnaud
MVP - VC


.



Relevant Pages

  • Re: implicit loading of dll ?
    ... You can tell if extern ... "C" is going to help by whether the function the linker can't find is called ... input header files and external dependency libraries. ... I have a thrid party library with header file, lib and dll files. ...
    (microsoft.public.windowsce.app.development)
  • Properties page > Linker
    ... I'm using Visual Studio 2003 .Net and Visual C++. ... If I open the project properties page, ... Linker> Input section, I try and enter this in the "Additional ... What's the syntax for multiple libraries? ...
    (microsoft.public.vc.ide_general)
  • RE: functioning XLL not loading properly on other machines
    ... options in visual Studios to include the compiled libraries into the EXE ... I don't have visual studio installed on my ... I went to maicrosoft.com and found these instructions to get into the Linker ... I suspect that it's a compiler switch that's set wrong or that the XLL ...
    (microsoft.public.excel.programming)
  • Re: ATL handles global/static initialization -- how?
    ... If you add /VERBOSE:LIB option to linker, you'll the list of libraries your ... >> I remember testing empirically that it works in ATL 7.1 and not in ATL ... > %PROGRAMFILES%\Microsoft Visual Studio .NET ...
    (microsoft.public.vc.atl)
  • Re: Relationship.....
    ... the dll files which are linked with compilers.iam using visual studio ... Those are what you feed the linker with. ... libraries can be either static or dynamic. ... - Dynamic libraries are a pair of a .lib and .dll files. ...
    (microsoft.public.vc.language)

Loading