Re: linking c++ and mathematica
- To: mathgroup at smc.vnet.net
- 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: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
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 properly. 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 outset. -- P.J. Hinton Mathematica Programming Group paulh at wolfram.com Wolfram Research, Inc. http://www.wolfram.com/~paulh/ Disclaimer: Opinions expressed herein are those of the author alone.