MLClose has been replaced by WSClose.

void MLClose(MLINK link)

closes a MathLink connection.


  • Calling MLClose() does not necessarily terminate a program at the other end of the link.
  • Any data buffered in the link is sent when MLClose() is called.
  • Programs should close all links they have opened before terminating.
  • MLClose() is declared in the MathLink header file mathlink.h.


Basic Examples  (1)

#include "mathlink.h"

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

    ep = MLInitialize((MLParametersPointer)0);
    if(ep == (MLENV)0)
        { /* environment initialization failed */ }

    lp = MLOpenArgv(ep, argv, argv + argc, &error);
    if(lp == (MLINK)0 || error != MLEOK)
        { /* link creation failed */ }



    return 0;

See Also

MLInitialize()  MLDeinitialize()  MLOpenArgcArgv()  MLOpenString()