Product Documentation

FairCom Low-Level API for C

Previous Topic

Next Topic

Compile Using Microsoft Visual Studio IDE

This section explains the steps to compile and run the tutorial from the Microsoft Visual Studio IDE. FairCom provides Microsoft Visual Studio solutions for Microsoft Visual Studio 2015, 2017, and 2019. You can find these solutions in the various “Microsoft Visual Studio” directories in the <faircom>\drivers\c.lowlevel\tutorials\IDEProjects directory. Please choose the one which corresponds to the version of Visual Studio you have installed.

This tutorial requires the Microsoft Windows SDK to be installed on your computer. See Microsoft Windows SDK.

If the FairCom Database Engine is not already running on your machine, start the server as explained in Starting the FairCom Database Engine.

The source code is located in this directory: <faircom>\drivers\c.lowlevel\tutorials

How to Use the Visual Studio Environment

  1. Load the Tutorials.sln file that corresponds to your version of Visual Studio by double-clicking the .sln file.
  2. To build these samples, use the Build menu of Microsoft Visual Studio and pick the Build Solution item:

    Visual Studio Build

  3. To run the tutorial, choose Start Debugging in the Debug menu or simply press F5.
  4. To fully observe how this tutorial interacts with c-tree, step through the code with the debugger and execute it step-by-step using Step Into from the Debug menu or simply press F11.

  5. By default, the Visual Studio debugger will start the Tutorial1 project.

c-treeACE Version 11

Simple Low Level Function Example

Successfully created data files and indices

A)dd D)elete Q)uit:

To use this tutorial, press “A” to add a record, “D” to delete an existing record based on the record ID, and “Q” to quit the program.

When adding a new record, it asks for various field entries. Here are the data types which are expected for each of the fields:

  • Item ID: string
  • Description: string
  • Location: string
  • Quantity: float
  • Cost: float

Here is an example of adding a record:

A)dd D)elete Q)uit:a

ADD NEW DATA

Enter Item ID: 1

Enter Description: First Record

Enter Location: Los Angeles, CA

Enter Quantity: 42

Enter Cost: 99.99

Successful Addition

When you delete a record, it asks for the record / item ID, and either complains about a non-existent record ID (“Key not found”) or prints the contents of the record and then deletes it.

This program creates and populates a table data file ("invent.dat") and an index file ("invent.idx").

Troubleshooting

This section lists some errors you may encounter when compiling and running the tutorials.

Error MSB8036:

The Windows SDK version 10.0.15063.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".

This build error happens because the Windows SDK version that this solution was built against (10.0.15063.0) does not match the Windows SDK version that is currently installed on your computer.

To fix this, right-click on the solution (not one of the individual projects), and select Retarget Solution, and specify a Windows SDK installed on your computer.

The versions of the Windows SDK installed on your computer will be automatically listed. Choose one and click OK to retarget the solution.

Could not initialize c-tree
Error 133 on file -1

The most common cause of this runtime error is the FairCom Database Engine is not running on your machine. The most likely cause is that the c-tree evaluation license times out after 3 hours and shuts down the server. The solution is to restart the server. See Starting the FairCom Database Engine.

TOCIndex