Why do I need ILK, PDB and EXP files?

20,168

Solution 1

PDB files contain debug information and are useful if you need to step through the DLL's code at any point.

ILK files are used by the linker. They are not needed unless the DLL is to be recompiled.

EXP files contain information about things exported from the DLL

Solution 2

  • .ilk files are intermediary files created by the linker during the development cycle. .ilk files serve the purpose of incremental linking. If the linker does not find and .ilk file when trying to do incremental linking, then it will do a full linking and reproduce the .ilk file. Incremental linking is meant to speed up the linking process. You can safely delete .ilk files.

  • .exp files are for developers too. .exp files are created for .exe and .dll files that export some symbols. Their purpose is similar to .lib import libraries, but there is a subtle difference. .exp files are always created, even if the creation of the corresponding .exe or .dll fails at link time. By contrast, .lib import libraries are created only when the corresponding .exe or .dll linkage succeeds. .exp files help linking interdependent components. For example, an .exe might provide access to its common resources for its plugins by exporting some functions. The plugins also provide exports for the .exe to call. Interdependencies like this cannot be successfully linked. The .exe linkage will fail, because the import .lib for the .dll is missing. Consequently no .lib for the .exe will be created. The linkage of the .dll will fail because the import library for the .exe is missing. Export files however will be created even if linkage failed, so the .dll could link against the .exp file rather than the .lib file for successful linkage.

Share:
20,168

Related videos on Youtube

Serenity Stack Hoolder 099
Author by

Serenity Stack Hoolder 099

t&Roll

Updated on July 09, 2022

Comments

  • Serenity Stack Hoolder 099
    Serenity Stack Hoolder 099 about 2 years

    I have downloaded some dll files and with it came also pdb, exp and ilk files. Now I need to know do I need to put them in my system file, or not and what is the purpose of each of them in the general?

  • Serenity Stack Hoolder 099
    Serenity Stack Hoolder 099 about 12 years
    Well explained, so it would be advisable to include PDB and EXP files to my sys directory?
  • Laszlo
    Laszlo over 4 years
    So what is the purpose of EXP files? When do we need EXP files? The accepted answer does not actually provide an answer.
  • frankenapps
    frankenapps about 4 years
    Can .exp files be safely deleted, too?
  • Andrei Despinoiu
    Andrei Despinoiu about 3 years
    It seems that .ilk and .exp files can be deleted, and it works just as well, as long as you're using .lib and .dll. They will be generated each time you compile the project in Visual Studio (in Debug mode). They're not needed if you start the application using a batch file that reads: start /d .. MyProjectName_Debug.exe (which sets the "working directory" there). Those files are used for incremental linkage when using the "Edit and Continue" feature of Visual Studio.