Why does winpcap require both .lib and .dll to run?

Specifications can be seen here:

http://www.winpcap.org/docs/docs_40_2/html/group__wpcapsamps.html

Very strange, either .lib

, or .dll

enough IMO, why is it needed?

+2


a source to share


3 answers


In general, the linker is needed .lib

and .dll

at runtime. The file .lib

is called an "import library", which contains the glue that tells the linker that the functions you call can be found in the appropriate file .dll

.

You will probably find that only the file is required at runtime .dll

.



It is a widely used layout for Win32 DLL projects and is not limited to Winpcap.

+1


a source


This is not only with winpcap, all external libraries are like that.



  • When you compile source codes that use a specific library, you need header files *.h

    from that library and you will get the files*.o

  • When you link these files *.o

    with executables, you will need the files *.lib

    or *.dll.a

    .
  • When you run these executables you need the *.dll

    files
+1


a source


If you are calling Dll you will need a Lib with this. you can see the link below for more information

This is from wikipedia

Linking to dynamic libraries is usually done by referencing the import library (your .LIB) when creating or linking to create the executable. The generated executable file then contains an import address table (IAT) that is referenced by all DLL function calls (each DLL function that is referenced has its own IAT entry). At run time, the IAT is populated with appropriate addresses that point directly to a function in a separately loaded DLL.

0


a source







All Articles