Re: Calling Mathematica-4.0 from C Code.
- To: mathgroup at smc.vnet.net
- Subject: [mg26667] Re: Calling Mathematica-4.0 from C Code.
- From: Ulrich Hofstoetter <ulrich.hofstoetter at visualanalysis.com>
- Date: Wed, 17 Jan 2001 00:47:20 -0500 (EST)
- Organization: Visual Analysis
- References: <93r8sn$4vp@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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 file.tm -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
Information).
or the Examples delivered with Mathlink
(PathToMathematica/AddOns/MathLink/DevelopersKists/Solaris(??)/MathLinkExamples)
Yours
Uli
--
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 visualanalysis.com
www: http://www.visualanalysis.com