Compile and link it into a DLL (you may need to widen this window to see the example properly):
When using the Microsoft C compiler shipped with LANSA, the PATH, INCLUDE and LIB environment variables need to be initialized with the location of this compiler. First, run the cmd program to open up a command prompt. Then set the environment variables using the following examples. You will need to change the directory name to reflect where you have installed LANSA:
set Path=C:\Program Files\LANSA\MicrosoftCompiler90\bin;%Path%
set INCLUDE=C:\Program Files\LANSA\MicrosoftCompiler90\include;%include%
set LIB=C:\Program Files\LANSA\MicrosoftCompiler90\lib;%lib%
When using a Microsoft compiler direct from Microsoft, open a command window using the Microsoft-installed short cut similar to Visual Studio Command Prompt (2010) in the Microsoft Visual Studio 2010\Visual Studio Tools program folder. This sets up the required environment variables.
Change the current drive to be .....\X_LANSA\SOURCE
---> Edit the .C file via a standard source editor
| To attempt a compile and link, for Microsoft C/C++ use Command:
| NMAKE /e /a /f U_BIFnnn.MAK SRCROOT=D:\LANSAV10\X_WIN95\X_LANSA TRGROOT=D:\LANSAV10\X_WIN95\X_LANSA
| See Command Notes below
---- If errors detected
If no errors, test by executing an RDML function
that uses your built-in function.
Backup your .C, .MAK, .WMK, .DEF and .DLL files.
(the DLL is created in the x_lansa/execute directory).
In this command:
NMAKE /e /a /f U_BIFnnn.MAK SRCROOT=D:\LANSAV10\X_WIN95\X_LANSA TRGROOT=D:\LANSAV10\X_WIN95\X_LANSA
SRCROOT is the location of the SOURCE directory where the .C is located
TRGROOT is the location of the EXECUTE & OBJECT directories where the .OBJ & .EXE will be created.
The paths cannot contain directory names that contain spaces. This is a restriction of Microsoft's NMAKE utility. To obtain an alternative name (otherwise known as a short name) for the directory with a space in it, open a "Command Prompt" window and use the "/X" option with the DIR command (i.e. DIR /X). The short name will be displayed next to the long name. For example, the common windows directory "PROGRAM FILES" will typically have a short name of "PROGRA~1". Your NMAKE command may look like this:NMAKE /e /a /f U_BIFnnn.MAK SRCROOT=D:\PROGRA~1\LANSA\X_WIN95\X_LANSA TRGROOT=D:\PROGRA~1\LANSA\X_WIN95\X_LANSA