Mathematica > 系统界面与配置 > C/C++ 语言接口 > MathLink C 语言函数 > MLENV >
Mathematica > 系统界面与配置 > MathLink API > MathLink C 语言函数 > MLENV >

MLENV


is a MathLink type representing a MathLink library environment.
  • The MathLink environment object stores the global state of MathLink during the execution of a program.
  • MLENV is defined in the file mathlink.h, which should be included in the source code for any MathLink-compatible program.
  • Each MathLink program must create a MLENV object before accessing any other MathLink functionality.
  • MLENV is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

int main(int argc, char **argv)
{
    MLENV env;
    MLINK link;
    int error;

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

    link = MLOpenArgcArgv(env, argc, argv, &error);
    if(link == (MLINK)0 || error != MLEOK)
        { /* unable to create the link */ }

    /* ... */

    MLClose(link);
    MLDeinitialize(env);
    return 0;
}
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
格式:   HTML  |  CDF