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


is a MathLink type representing a MathLink link object.
  • MLINK is defined in the file mathlink.h, which should be included in the source code for any MathLink-compatible program.
#include "mathlink.h"

int main(int argc, char **argv)
    MLENV ep;
    MLINK lp;
    long error;

    ep = MLInitialize((MLParametersPointer)0);
    if(ep (MLENV)0)
        { /* unable to initialize environment */ }

    lp = MLOpenArgcArgv(ep, argv, argv + argc, &error);
    if(lp (MLINK)0 || error MLEOK)
        { /* unable to create link */ }

    /* ... */

    return 0;