Including the Db2 Spatial Extender header file in spatial applications

Db2 Spatial Extender provides a header file that defines constants that can be used with the stored procedures and functions of the Db2 Spatial Extender.

About this task

Recommendation:
If you plan to call Db2 Spatial Extender stored procedures or functions from C or C++ programs, include this header file in your spatial applications.

Procedure

To include the Db2 Spatial Extender header file in spatial applications:

  1. Ensure that your Db2 Spatial Extender applications can use the necessary definitions in this header file.
    1. Include the Db2 Spatial Extender header file in your application program.
      The header file has the following name:
      
      db2gse.h
      

      The header file is located in the db2path/include directory, where db2path is the installation directory where the Db2 database system is installed.

    2. Ensure that the path of the include directory is specified in your makefile with the compilation option.
  2. If you are building Windows 64-bit applications on a Windows 32-bit system, change the DB2_LIBS parameter in the samples/extenders/spatial/makefile.nt file to accommodate 64-bit applications.
    The necessary changes are highlighted in the following example:
    
    DB2_LIBS = $(DB2_DIR)\lib\Win64\db2api.lib