4.3 LANSA Open and C
Any C module making LANSA Open function calls should include the LCOE.H header file which is installed with the 'Development Tools'. The LCOE.H header file contains a list of constants required for the parameters used by the DLL functions. This file also contains the definition of each of the DLL functions.
When using the LCOE.H header file, it is necessary to define a macro to indicate what operating system the application is being compiled for.
- For 32 bit Windows, the macro LCE_WIN32 must be defined.
These macros should be defined before the LCOE.H file is included. This step may be done inside the code or outside the code, by defining the macro when calling the compiler (Option ‑D on most compilers) or in your project's settings.
There are two methods to include LANSA Open when compiling your project.
1. The recommended method is to link the installed lcoew32.lib file to your project. See your compiler's documentation on how to perform this task. In general terms, this is performed by adding lcoew32.lib as a dependency to your project's Linker settings.
2. In previous versions of LANSA Open the following method was documented:
"To create an Import Library for Windows, you should create your own Import Library file using a DEF file as input to the LIB utility. The SAMPLES\C directory has an example of a DEF file for this purpose, with additional information as comments. Refer to Microsoft documentation describing the LIB utility and modify the example DEF file as required."
You may continue to use this method but it is no longer the recommended method.