This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MathLink C Function

MLErrorMessage()

const char * MLErrorMessage(MLINK link)
returns a character string describing the last error to occur on link.
  • MLErrorMessage() is declared in the MathLink header file mathlink.h.
#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))
    {
        /* unable to send 3.22 to lp */
        printf("MathLink Error: %s\n", MLErrorMessage(lp));
    }

    /* ... */
}