Reputation: 7664
I wanted to download the lame library for use in my C# project to convert audio. I found the files to use here (libmp3lame)
When I downloaded the archive, I found the .dll
I was looking for but along with them, there were 2 others files:
My question:
.dll
file.dll
library cant?Edit: I have a feeling that these files are not for use in C#. More for C++. But either way, what are those files? And what are they used for?
Upvotes: 6
Views: 3947
Reputation: 283684
If you think about the method for consuming a native DLL in .NET (p/invoke), your p/invoke declarations have several parts:
DllImportAttribute
specifying the DLL where the function is found and its key in the export table (mangled 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's DllImportAttribute
, in C and C++ the calling convention is stored with the function signature in the header file.
Upvotes: 0
Reputation: 48696
Both lib
files and exp
files are used with native code development (e.g. 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 DLL
files, except the big difference being DLL files are linked dynamically and LIB
files are linked statically, when you compile your program.
exp
files are export files. There are kind of like metadata files that tell your compiler which functions in a DLL have been exported, and therefore can be reused in your statically linked program. .NET program do not require this because each .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.
Upvotes: 6