Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

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





  • 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