c# - Adding MinGW compiled DLL to Visual Studio fails -
i have written library in c want able used in c#, c++, , python (other languages nice, not necessary now). library developed in linux , have been able compile on windows via mingw. problem having when trying add .dll
reference in visual studio 2010 solution. error is:
a reference 'c:\path\to\libmylibrary.dll' not added. please make sure file accessible, , valid assembly or com component.
i have spent time trying see if compiling dll incorrectly, don't see glaring out @ me. references i've used this, this, , this.
if more information needed can provide compilable example source code.
there 2 ways add "dll" c# project.
if dll clr assembly, meaning managed code adheres clr, can add "reference".
if dll not clr assembly, can load code manually using p/invoke structure. there's lot of online documentation on p/invoke. messy, works. need declare each dll entry function using [dllimport]
attribute, , load dll manually. search p/invoke.
based on error message, trying load plain dll clr dll. means you'll have figure out how use p/invoke.
Comments
Post a Comment