MathGroup Archive 1998

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

Search the Archive

Re: linking c++ and mathematica

  • To: mathgroup at
  • Subject: [mg13668] Re: linking c++ and mathematica
  • From: "P.J. Hinton" <paulh>
  • Date: Sat, 15 Aug 1998 04:39:03 -0400
  • Organization: "Wolfram Research, Inc."
  • References: <6qp22n$>
  • Sender: owner-wri-mathgroup at

On 11 Aug 1998, Hwee Kuan Lee wrote:

> I am trying to link c++ program with mathematica - both ways.
> MORE IMPORTANTLY,  I would like to use some mathematica routines like
> "FindRoot", "NSolve" in my C++ program.
> I had been reading the online help, but didn't manage to find any good
> help. can anyone tell me where to get help on this topic, or how to do
> it?
> thanks.
> p/s i had been trying to use mathlink - call c functions in mathematica,
> but without success.

It is not clear from the description of your problem for me to discern
what may lie at the source of your problems.  I can give you some
guidelines that may get you on the right course.

1) Before starting out on a new project, it is often helpful to try
building a MathLink executable from sources that have been coded

The MathLink Developer Kit comes with a number of examples that should
be fairly easy to build.  If you run into troubles building these
examples, then you will probably need to learn more about you compiler
so that you can get them to build successfully.

2) Once you can get the examples to build and run successfully, take a
look at the source code for examples that are relevant for your work.

MathLink can be used to create executables that act either call the
kernel or install into the kernel.  It sounds as if you are wanting to
do the former.  This is usually considered the more difficult task.  A
very simple example of calling the kernel from a program is given in
the   factor*.c source files.

These steps should prove useful to in getting comfortable with the
MathLink API and help you to write better original code from the

P.J. Hinton
Mathematica Programming Group           paulh at Wolfram
Research, Inc.        
Disclaimer: Opinions expressed herein are those of the author alone.

  • Prev by Date: Re: What is the fastest machine for Mathematica?
  • Next by Date: Re: Request for help: working with multi-level lists
  • Previous by thread: Re: linking c++ and mathematica
  • Next by thread: what does error msges means?