Go to: Search
FIB > Computing laboratory > Documentation > Information on the subjects > Information on FBD Català | Castellano


LEDA -IEA/EA- libraries
Information on FBD
Information on JDK
Information on Mathematica



Information on FBD

Last modified: 14-06-2002


v1.1: 8 March 2000


The FBD laboratory work and practicals are carried out in the Windows 95 (PC network) environment. Microsoft Visual C++ and pre-compiler Informix esql are used.

In order to correctly compile ESQL code, you must follow the instructions below:

In order to correctly compile CLI code, you must follow the instructions below:

  • Define the ODBC data sources (once)
  • Define the environment variables.
  • Compile the CLI program


DOS environment variables

The compilation of ESQL (Embedded-SQL) and CLI (Call Level Interface) code must be done in an MS-DOS window, after executing the vcvars32 command. This command defines the necessary environment for using Visual C++:

F:\FBD VCVARS32
Setting the environment for using Microsoft Visual C++ tools.


Compiling ESQL (Embedded-SQL) code

In order to compile ESQL code, you must use a makefile file similar to that shown below. In this example, the program prova.ec is compiled:

##
##	Makefile for INFORMIX-ESQL/C 7.1
##
!include <win32.mak>
# INFORMIXDIR environment variable is not set by the install program.
# You will need to set this to the directory where you have installed
# the INFORMIX-CLI product.
ESQL_LIBS  = $(INFORMIXDIR)\lib\isqlt09a.lib
ESQL_INCL  = $(INFORMIXDIR)\incl\esql
ESQL_CFLAGS= -c /I$(ESQL_INCL)
# targets that need compiling
PROVA     = prova.exe
TARGET    = $(PROVA)
all: $(TARGET)
# How is it constructed?
prova.exe : prova.ec
    esql.exe $(ESQL_EXE_FLAGS) prova.ec $(ESQL_CFLAGS)
    link prova.obj $(ESQL_LIBS)

Once you have created a makefile file similar to the one above, you can run the nmake command in order to compile and generate an executable file (prova.exe):

F:\FBD nmake


ODBC data source definition

The first step to be followed when compiling CLI code is to define an ODBC data source through which the connections with the Informix database will be established.

  • Go Start > Settings > Control Panel > ODBC Data Sources (32bit):
  • Add a new user data source name (User DSN) from the ODBC Data Source Administrator:
  • Select the most recently updated Informix driver, that is, INFORMIX 3.30 32 BIT:
  • Fill in the fields of the General tab as shown in the following figure:
    • Data Source Name: ada_fbd
    • Description: FBD database

  • Fill in the fields of the Connection tab as shown in the following figure:
    • Server Name: ada_fbd
    • Host Name: ada
    • Service: 1529
    • Protocol: onsotcp
    • Database Name: The database name
    • User Id: The user name (is not required. This is done by the program)
    • password: The user password (is not required. This is done by the program)

  • Check the data source has been created:


Compile CLI code (Call Level Interface)

In order to compile CLI code, you must use a makefile file similar to that shown below. In this example, the program prova.ec needs compiling. :

!include <win32.mak>
# INFORMIXDIR environment variable is not set by the install program.
# You will need to set this to the directory where you have installed
# the INFORMIX-CLI product.
CLI_LIBS  = $(INFORMIXDIR)\lib\iclit09a.lib
CLI_INCL  = $(INFORMIXDIR)\incl\cli
CLI_CFLAGS= /I$(CLI_INCL)
# targets
PROVA     = prova.exe
TARGET    = $(PROVA)
all: $(TARGET)
# Rules
.c.exe:
    $(cc) $(cflags) $(cdebug) $(CLI_CFLAGS) $*.c
    $(link) $(conlflags) $(ldebug) $*.obj $(CLI_LIBS) $(conlibs)

Once you have created a makefile file similar to the one above, you can run the nmake command in order to compile and generate an executable file (prova.exe):

F:\FBD nmake



printer friendly version