Mathlink MLGetString in C++
- To: mathgroup at smc.vnet.net
- Subject: [mg23480] Mathlink MLGetString in C++
- From: FiG <fig367 at mad.scientist.com>
- Date: Fri, 12 May 2000 22:54:20 -0400 (EDT)
- Organization: Eircom.Net http://www.eircom.net
- Sender: owner-wri-mathgroup at wolfram.com
Hi all,
I'm using Mathematica as a computational engine, creating my
own front end, as it were.I'm using MLPutString and
MLGetString as my connections to the mathkernel. However,
the second argument of MLGetString is a const char **. This
causes problems in C++ under the stronger type checking. I'm
using MS visual C++ compiler ver 6 , and the ml32i2m.lib
file supplied with mathlink ver 3.7, system is winnt ver 4
with Mathematica 4
The following code fragment
MLINK lp;
char ** ml_outout;
MLGetString(lp,ml_output);
will compile fine under a dot c extension file, but will
fail under a dot cpp extension file due to the stronger type
checking.
Things tried:
use const char ** ml_output - this compiles fine under C++
but will crash the program, as the mathkernel attempts to
change const ml_output.
use in the header file
extern "C" {MLGetString(MLINK, char **);}
this causes a complier error of error --- C2733: second C
linkage of overloaded function 'MLGetString' not allowed
Suggestions?
Thanks in advance.
Cheers
\Andrew
Student at Dublin City University
Computer Applications (Evening) Year 4