In Visual C++ , when I build a dll , the output files are .dll and .lib.
Is the name of the dll built into the .lib file .
The reasson I ask this question is : When I built my exe by importing this dll and run the exe , the exe tries to locate the dll to load it in the process address space .
As we just specify the library name (.lib file) in the project properties , how does the exe get to know the name of the dll .
Note : I dumpbin libary file (.lib) and saw that it does not contain the name of the dll .
The LIB file is turned into an import table in the EXE. This does contain the name of the DLL.
You can see this if you run
dumpbin /all MyDLL.lib. Note thatdumpbin MyDll.libby itself doesn’t show anything useful: you should use/all.This shows all of the sections defined in the .LIB file. You can ignore any
.debugsections, because they wouldn’t be present in a Release build. In the .LIB file, there are a collection of .idata sections. In the DLL project that I just built, the LIB file contains a.idata$4section which defines the symbols to be put in the EXE’s import table, including the DLL name: