OpenersNotesSection(Spacer1)Details

For computer systems where the MathLink libraries are distributed as dynamic library modules, MLVersionNumbers() allows a runtime inspection of the version information for the MathLink library.

MLVersionNumbers() will also function for programs that use the MathLink library statically; however, the function return values will not change.

MLVersionNumbers() 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 <stdio.h>
#include "mathlink.h"

int main()
{
	MLENV env;
	int interface;
	int revision;
	int build;

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

	MLVersionNumbers(env, &interface, &revision, &build);

	if(!(interface >= 3))
		{
		printf("Incorrect MathLink library available.\n");
		MLDeinitialize(env);
		return 1;
		}

	/* ... */

	MLDeinitialize(env);

	return 0;
}