This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
MathLink C Function

MLVersionNumbers()

void MLVersionNumbers(MLENV ep, int *inumb, int *rnumb, int *bnumb)
returns the MathLink API interface number, revision number, and build number and stores them respectively in inumb, rnumb, and bnumb.
  • 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 mathlink.h.
#include <stdio.h>
#include "mathlink.h"

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

    env = MLInitialize((char *)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;
}