MathGroup Archive 1999

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

Search the Archive

MathLink String type

  • To: mathgroup at
  • Subject: [mg19993] MathLink String type
  • From: fischerc at
  • Date: Thu, 23 Sep 1999 23:26:34 -0400
  • Organization: - Share what you know. Learn what you don't.
  • Sender: owner-wri-mathgroup at

I am not able to compile simple MathLink function (Mathematica v. 4, Linux),
which use a string as an argument. Like this:

:Function:       StringLength
:Pattern:        StringLength[s_String]
:Arguments:      { s}
:ArgumentTypes:  { String }
:ReturnType:     Integer

:Evaluate: StringLength::usage = "StringLength[s_String] gives the
length of s."

#include "mathlink.h"

int StringLength( char * s)
{ int i=0; char *t = s;
  while(*(t++)) i++;
  return i; }

int main(argc, argv)int argc; char* argv[];
{ return MLMain(argc, argv); }

The compiling stage aborts with conflicting types for `StringLength' previous declaration of `StringLength'

The mcc compiler replaces the  char * s argument specification by
int StringLength P(( kcharp_ct _tp1));
Such declaration I do not understand well.
Thank for the advice

Sent via
Share what you know. Learn what you don't.

  • Prev by Date: TeXForm in v4 better?
  • Next by Date: Contourline values
  • Previous by thread: Re: TeXForm in v4 better?
  • Next by thread: Re: MathLink String type