From 652c6e1011554d25da154e93c53cebf5337f89cc Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Thu, 15 Aug 2013 18:31:52 +0300 Subject: [PATCH] Stripped "lib" from the beginning of a library name for compatibility with the .NET (that is, on Windows) way of importing DLL-s. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index fe08c1fe..98a2a205 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -2114,6 +2114,10 @@ namespace CppSharp.Generators.CSharp libName = (library != null) ? library.FileName : "SymbolNotFound"; libName = Path.GetFileNameWithoutExtension(libName); } + if (libName != null && libName.Length > 3 && libName.StartsWith("lib")) + { + libName = libName.Substring(3); + } Write("[DllImport(\"{0}\", ", libName);