In-source way to call any C Library

Jesse Phillips jessekphillips+D at gmail.com
Fri Mar 18 13:27:10 PDT 2011


Adrian Iliescu Wrote:

> Is there a way to call a C function without having to screw around with the
> linker on the command line?  In C#, for example, this is all you have to do:
> 
>         [DllImport( @"..\Debug\CLibTest.dll" )]    //location
>         internal static extern int MyTestResult(); //name of function
> 
>         void CSUsingCLib()
>         {
>             int result = MyTestResult(); //use it
>         }

You may find the Library referenced here useful:
 http://stackoverflow.com/questions/3818229/loading-plugins-dlls-on-the-fly


More information about the Digitalmars-d-learn mailing list