What is a .exp file and a .lib file and how can I use them in my C # project?

I wanted to download the lame library to use in my C # project for converting audio. I found files to use here (libmp3lame)

When I downloaded the archive, I found .dll

what I was looking for, but there were 2 more files along with them:

  • libmp3lame.dll
  • libmp3lame.exp
  • libmp3lame.lib

My question is:

  • 1 What are these files used for? And how can I use them in my project other than the file.dll

  • What is the use of these files give me what a library .dll

    can not?

Edit: I have a feeling that these files are not used in C #. More for C ++. But what are these files anyway? And what are they used for?

+3


source to share


2 answers


Both files lib

and exp

files are used with embedded code development (like C ++ / VB6 / Win32) and are not used at all in the .NET world.

lib

files contain a collection of reusable code or data, or both, that can be statically linked and reused with your existing code. They are similar to files DLL

, except for a big difference in that DLL files are dynamically linked and files are lib

statically linked when your program is compiled.



exp

files are export files. There are similar metadata files that tell you that your compiler, which runs in a DLL, has been exported and can therefore be reused in your statically linked program. A .NET program does not require this because every .NET DLL has a special section called the CLR metadata section .. NET programs can use reflection to pull this metadata information and see which methods are available.

+3


source


If you are thinking of a method for using a native DLL in .NET (p / invoke), your p / invoke declarations have several parts:

  • Function signature (return time, argument types)
  • DllImportAttribute

    DLL specifying where the function is found and its key in the export table (malformed name or ordinal)


In C and C ++, the header file provides the first, and the import library ending in .lib

provides the second.

Unlike p / invoke DllImportAttribute

, in C and C ++, the calling convention is stored with the function signature in the header file.

0


source







All Articles