Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
gcc -I /usr/lmx-sdk-4.6.1/include/

MSCV:

 

 

Panel
cl /I “C:\Program Files\X-Formation\LM-X SDK v4.6.1 win64_x64\include\”

 

 

...

 

Commonly used functions

In the following examples we will present five commonly used LM-X API functions.

...

The LMX_Init function initializes the protection system. This function creates a handle needed to use other LM- X API functions. It returns LMX_STATUS variable that indicates initialization status. 

Code Block
LMX_STATUS LMX_Init(LMX_HANDLE *p)

 

...

Code Block
LMX_HANDLE LmxHandle;

if (LMX_Init(&LmxHandle) != LMX_SUCCESS)
{
  printf("Unable to initialize!\n");
  return 1;
}

LMX_STATUS LMX_SetOption(LMX_HANDLE LmxHandle,
                         LMX_SETTINGS eOption,
                         const void *pSetting);

...

The LMX_Checkin function returns the licenses for a single checked out feature or all checked out features.

 

Code Block
LMX_STATUS LMX_Checkin(LMX_HANDLE LmxHandle, const char *szFeatureName, int nCount);

...

LMX_Free

The LMX_Free function, which has an inverse effect to LMX_Init, frees any allocated memory used by the licensing system and closes any open connection to a license server.

...

To compile your first program run the following:

GCC: 

Code Block
gcc
 -c -pthread -fPIC -Wall -Werror -fno-strict-aliasing -m64 
-Wfatal-errors -Wno-unused-local-typedefs -Wno-vla -Wno-attributes -O2 
-c -O2 -I/usr/lmx-sdk-4.6.1/include/ example.c
 
gcc -static-libgcc -o local local.o /usr/lmx-sdk-4.6.1/linux_x64/liblmxclient.a -pthread -lrt -ldl

MSVC:

 

Code Block
cl /WX /MT /c /O2 -D_CRT_SECURE_NO_DEPRECATE /I "C:\Program Files\X-Formation\LM-X SDK v4.6.1 win64_x64\include\" example.c
 
link /WX /opt:noref example.obj "C:\Program Files\X-Formation\LM-X SDK v4.6.1 win64_x64\win64_x64\liblmxclient_mt.lib"

...

Running your application

Now you should have the following files in your current directory:

...