How to use multiple development languages

I am programming in Delphi (D7 and D2006) on Windows XP (switching to Windows 7 soon). I need to use the math library for some of the work that I am doing, and most of the math libraries (I tend to Mathematica at the moment) that I have looked at will create compiled C code. Such code will provide certain functions for my main programs.

I have a very simple question - given this development setting - how can I start using compiled c code from Delphi? I really need baby steps to make me start the process.

+3
source share
4 answers

I have done quite a bit with my FE OrcaFlex product . You have two options for linking to your C code from Delphi: static or dynamic. I bind statically because it simplifies distribution and version control. But this is really quite a trick to make it work statically, and you have to rely on a number of undocumented aspects of Delphi.

, . C DLL. Borland C . BCC55. Borland C , 8087, Delphi. MSVC, , MS . Borland C . , , , , .

, C C, . Delphi, cdecl.

, , - . , - (, Delphi) . PChar ( PAnsiChar PWideChar, , Delphi 2009 ).

+4

SDL Lohninger (http://www.lohninger.com/mathpack.html). Delphi , , .

, . , , !

+3

Mathematica, guide/CLanguageInterface, .

, Mathematica C-, Mathematica MathLink, , , , Mathematica. , .

. Code Generator.

C- DLL, Delphi .

function MathematicaRoutine(const x : double) : double; external 'MyInterface.dll';

, , , , Mathematica , . .

+2
source

You can mix your project with Delphi and C ++ (Builder) using RAD Studio. Place the automatically generated C code in a C ++ Builder (.cpp) file, and add the Delphi files for the rest.

+2
source

Source: https://habr.com/ru/post/1776956/


All Articles