NO FRAMES

CPXputenv

int CPXPUBLIC CPXputenv(const char * envsetting_str)
Definition file: cplex.h
Include files: cplex.h

The routine CPXputenv sets an environment variable to be used by CPLEX. Use it instead of the standard C Library putenv function to make sure your application ports properly to Windows. Be sure to allocate the memory dynamically for the string passed to CPXputenv.

As with the C putenv routine, the address of the character string goes directly into the environment. Therefore, the memory identified by the pointer must remain active throughout the remaining parts of the application where CPLEX runs. Since global or static variables are not thread safe, ILOG recommends dynamic memory allocation of the envsetting string.

Example

 char *envstr = NULL;
 envstr = (char *) malloc (256);
 if ( envstr != NULL ) {
    strcpy (envstr,
 	          "ILOG_LICENSE_FILE=c:\\myapp\\license\\access.ilm");
    CPXputenv (envstr);
 }
 

Parameters:

envsetting_str

A string containing an environment variable assignment. This argument typically sets the ILOG_LICENSE_FILE environment variable that customizes the location of the license key.

Returns:

The routine returns 0 (zero) when it executes successfully and -1 when it fails.