I\'m trying to use the lame_enc.dll file from LAME in a C# project, but adding the thing seems impossible.
I keep getting an error that says that a reference could not b
To use an unmanaged dll (native C++) in C#, you have to use DllImport, not adding a reference to the project in visual studio (and that is why you get an error).
Here is the documentation of DllImport from the MSDN.
You have to use P/Invoke to call unmanaged APIs from managed code.
You will need to use PInvoke to call functions in your native lame dll. However, you will only be able to call functions that have been exported as "C" style.
You can use a tool like "PInvoke Interop Assistant" that will help you when working out the PInvoke call signatures to make calls from C# to your native dll:
http://clrinterop.codeplex.com/releases/view/14120
You can only add managed assemblies as a reference to a managed project. What I normally do in this situation is to add it as ressource instead with "copy local" settings. That way the DLL is tied to and deployed with your project. I then use DllImport to manually get the APIs I need from that DLL.