This feature is not supported on the Wolfram Cloud.

has been replaced by WSDeinitialize.

void MLDeinitialize(MLENV env)
destructs the MathLink environment object.


  • The MathLink environment object stores the global state of MathLink during the execution of a program.
  • MLDeinitialize() must be called before the program exits.
  • MLClose() must be called for all open links before calling MLDeinitialize().
  • An appropriate call to MLDeinitialize() is generated automatically when an external program is created from MathLink templates.
  • MLDeinitialize() is declared in the MathLink header file mathlink.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "mathlink.h"

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

    ep = MLInitialize((MLEnvironmentParameter)0);


    return 0;
Translate this page: