OpenersNotesSection(Spacer1)Details

(NonWLLink[MLInitialize(), paclet:ref/c/MLInitialize]) must be called before MLOpenString.

MLOpenString() takes a single string instead of the argv array used by (NonWLLink[MLOpenArgcArgv(), paclet:ref/c/MLOpenArgcArgv]).

Arguments in the string are separated by spaces.

On some computer systems, giving NULL in place of the string pointer will cause arguments to be requested interactively, typically through a dialog box.

MLOpenString() 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()
{
	MLENV env;
	MLINK link;
	int error;

	env = MLInitialize((MLEnvironmentParameter)0);
	if(env == (MLENV)0)
		{ /* unable to initialize MathLink environment */ }

	link = MLOpenString(env, "/usr/local/bin/math -mathlink", &error);
	if(link == (MLINK)0 || error != MLEOK)
		{ /* unable to create link to the Kernel */ }

	/* ... */

	MLClose(link);
	MLDeinitialize(env);

	return 0;
}

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

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