Contents Index Build process for UltraLite embedded SQL applications Preprocessing your embedded SQL files pdf/preface.pdf

UltraLite User's Guide
  Developing Embedded SQL Applications
    Building embedded SQL applications

Configuring development tools for embedded SQL development


The SQL preprocessor and the UltraLite generator are key features of UltraLite application development. Most development tools use a dependency-based model to assist in compilation, and this section describes how to incorporate UltraLite features into such a model.

For a general overview of the techniques needed, see Configuring development tools for UltraLite development.

The UltraLite plug-in for Metrowerks CodeWarrior automatically provides Palm Computing platform developers with the techniques described here. For information on this plug-in, see Developing UltraLite applications with Metrowerks CodeWarrior.

This section describes how to add UltraLite code generation and the SQL preprocessor into a dependency-based development environment. The specific instructions provided are for Visual C++.

For a tutorial describing details for a very simple project, see Tutorial: Build an Application Using Embedded SQL.

SQL preprocessing 

The first set of instructions describes how to add instructions to run the SQL preprocessor to your development tool.

To add embedded SQL preprocessing into a dependence-based development tool

  1. Add the .sqc files to your development project.

    The development project is defined in your development tool. It is separate from the UltraLite project name used by the UltraLite generator.

  2. Add a custom build rule for each .sqc file.

  3. Compile the .sqc files, and add the generated .c files to your development project.

    You need to add the generated files to your project even though they are not source files, so that you can set up dependencies and build options.

  4. For each generated .c file, set the preprocessor definitions.

UltraLite code generation 

The following set of instructions describes how to add UltraLite code generation to your development tool.

To add UltraLite code generation into a dependency-based development environment

  1. Add a dummy file to your development project.

    Add a file named, for example, uldatabase.ulg, in the same directory as your generated files.

  2. Set the build rules for this file to be the UltraLite generator command line.

    In Visual C++, use a command of the following form (which should be all on one line):

    "%asany8%\win32\ulgen.exe" -q -c "connection-string" $(InputName) $(InputName).c

    where asany8 is an environment variable that points to your SQL Anywhere installation directory, connection-string is a connection to your reference database, and InputName is the UltraLite project name, and should match the root of the text file name. The output is $(InputName).c.

  3. Set the dummy file to depend on the output files from the preprocessor.

    In Visual C++, click Dependencies on the custom build page, and enter the names of the generated .c files produced by the SQL preprocessor.

    This instructs Visual C++ to run the UltraLite generator after all the necessary embedded SQL files have been preprocessed.

  4. Compile your dummy file to generate the .c file that implements the UltraLite database.

  5. Add the generated UltraLite database file to your project and change its C/C++ settings.

  6. Add the UltraLite imports library to your object/libraries modules list.

    In Visual C++, go to the project settings, choose the Link tab, and add the following to the Object/libraries module list for Windows development.

    $(asany8)\ultralite\win32\386\lib\ulimp.lib

    For other targets, choose the appropriate import library.


Contents Index Build process for UltraLite embedded SQL applications Preprocessing your embedded SQL files pdf/preface.pdf