Re: Interfacing C++ code to Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg16304] Re: Interfacing C++ code to Mathematica
- From: Pontus Lidman <pontus at lysator.liu.se>
- Date: Sun, 7 Mar 1999 01:05:36 -0500
- Organization: Linköping University, Sweden
- References: <7bo0on$dpg@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 5 Mar 1999, Roopesh Mathur wrote:
> The problem is that Mathlink code embedded in my C++ program, needs to be
> compiled, while the book recommends 'mcc', which can handle only C code. I
> would like to solve this problem without changing the C++ code to C, since
> I am using the object oriented capabilities of C++ significantly.
What you need to do is use "mprep" separately, that reads a MathLink
template and produces C source. You can then use a standard C compiler to
produce object code that can be linked together with your C++ code.
Remember to use extern "C" { } when you include any C header file in your
C++ code.
If you need more details, feel free to drop me an e-mail.
--
Pontus Lidman, pontus at mathcore.com, Development & support manager
All standard disclaimers apply. --- Void where prohibited.