MathGroup Archive 2000

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

Search the Archive

Mathlink MLGetString in C++

  • To: mathgroup at
  • Subject: [mg23480] Mathlink MLGetString in C++
  • From: FiG <fig367 at>
  • Date: Fri, 12 May 2000 22:54:20 -0400 (EDT)
  • Organization: Eircom.Net
  • Sender: owner-wri-mathgroup at

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

char ** ml_outout;

will compile fine under a dot c extension file, but will
fail under a dot cpp extension file due to the stronger type

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


Thanks in advance.

Student at Dublin City University
Computer Applications (Evening) Year 4

  • Prev by Date: Re: Re: ReExitDialog in ButtonfFunction
  • Next by Date: Re: Fonts in Plots?
  • Previous by thread: degree symbol "bug"
  • Next by thread: Re: [TS 3227] ListInterpolation