MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Calling Mathematica-4.0 from C Code.

Chia-Wei Wang wrote:

> Hi,
>    I am trying to get familiar with MathLink, especially calling
> Mathematica from a C code. So I copy the example file from Todd Gayley's
> "A MathLink Tutorial" at Chapter 2. But the manual does not say how to
> compilie that code and excute it. I am using Sun Unix System. Could
> someone tell me what is the procedure to make that code work? Thank you
> very much.
> With Regards
> Chiawei
> ________________________________________________________________________

Create a Makefile that does the following:
1. create a c-file from the tm-file (mprep -o filetm.c)
2. compile the c-file to object files and link them
    gcc -IPathToMathlink.h -c file.c
    gcc -IPathToMathlink.h -c filetm.c
    gcc file.o filetm.o -LPathTolibML.a -l ML -o program

Check out the Help Browser (AddOns->MathLink Library -> System specific
or the Examples delivered with Mathlink

Dipl.-Inf. Ulrich Hofstoetter
Visual Analysis GmbH
Neumarkter Str. 87
D - 81673 Munchen

Tel: (+49)89-431981-38
Fax: (+49)89-431981-1
e-mail: ulrich.hofstoetter at

  • Prev by Date: Re: How can I transform the number of 123.456 into "123.456"?
  • Next by Date: Re: Partial Differential Equation
  • Previous by thread: Re: Calling Mathematica-4.0 from C Code.
  • Next by thread: Re: Calling Mathematica-4.0 from C Code.