OpenersNotesSection(Spacer1)Details

The MathLink environment object stores the global state of MathLink during the execution of a program.

MLDeinitialize() must be called before the program exits.

(NonWLLink[MLClose(), paclet:ref/c/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 (RefLink[mathlink.h, paclet:ref/file/mathlink.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "mathlink.h"

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

	ep = MLInitialize((MLEnvironmentParameter)0);

	...

 	MLDeinitialize(ep);
	return 0;
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLInitialize(), paclet:ref/c/MLInitialize])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Running the Wolfram System from within an External Program, paclet:tutorial/RunningTheWolframSystemFromWithinAnExternalProgram])}})}})