In-source way to call any C Library

Adrian Iliescu nona at liame.moc
Fri Mar 18 11:54:28 PDT 2011


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
        }


More information about the Digitalmars-d-learn mailing list