Mathlink and Builder C++

*To*: mathgroup at smc.vnet.net*Subject*: [mg70770] Mathlink and Builder C++*From*: "Jean-Noel.Aubertot" <Jean-Noel.Aubertot at grignon.inra.fr>*Date*: Fri, 27 Oct 2006 00:28:06 -0400 (EDT)*References*: <ehmu5d$sf7$1@smc.vnet.net>

Dear all, I am trying to use MathLink for the first time. I am trying to link Mathematica with C code compiled with Borland C++ Builder 6.0 under Windows XP. I have a problem to create a .exe file to be called from Mathematica. I tried to follow the manual: I created a .tm file (the same as the one described in the manual) that was preprocessed using mprep. It created a .c file. In the options of my Builder project, I added the following directories: C:\Program Files\Wolfram Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows\CompilerAdditions\mldev32\lib C:\Program Files\Wolfram Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows\CompilerAdditions\mldev32\include. I had to add a "main{}" in this file in order for Builder C++ to compile it. It worked fine: the c code is compiled, the header Mathematica.h seems to be found correctly, but the linker indicates unresolved external MathLink functions ("MLConnect", "MLFlush", "MLPutInteger", ...). Does anyone have an idea where these MLfunctions are defined? Did I used the correct directories? More generally, do you have an idea on how I could compile the file automatically produced by mprep? Any indication would be highly appreciated! Best regards, JN