MLErrorMessage has been replaced by WSErrorMessage.

const char * MLErrorMessage(MLINK link)

returns a character string describing the last error to occur on link.


  • MLErrorMessage() allocates memory for the message string that must be released. Use MLReleaseErrorMessage() to release the memory allocated by MLErrorMessage(). If MLErrorMessage() returns NULL, do not call MLReleaseErrorMessage() on the NULL value.
  • MLErrorMessage() is declared in the MathLink header file mathlink.h.


Basic Examples  (1)

#include "mathlink.h"

/* send the double precision floating-point number 3.22 to a link and print an error message if the send fails */

void f(MLINK lp)
    if(! MLPutReal64(lp, 3.22))
        const char *message = MLErrorMessage(lp);

        /* unable to send 3.22 to lp */
        printf("MathLink Error: %s\n", message);

        MLReleaseErrorMessage(lp, message);

    /* ... */

See Also

MLReleaseErrorMessage()  MLUCS2ErrorMessage()  MLUTF16ErrorMessage()  MLUTF32ErrorMessage()  MLUTF8ErrorMessage()  MLError()  MLClearError()