Product Documentation

c-treeDB API for C++

Previous Topic

Next Topic

Command-Line Compile - Linux

This section explains the steps to compile and run the tutorials from the Linux command line/command shell.

If the FairCom Database Engine is not already running on your machine, start the server. See Setting up the FairCom Database Engine.

Compiling

To compile a tutorial from the Linux command line, follow these steps:

  1. CD into the proper folder:

    drivers/cpp.nav/tutorials/cmdline

  2. Execute make:

    >make

  3. If make works, it prints...

The ctpp tutorials are ready to run.

Type 'make run' to run the tutorials.

Running

Be sure the FairCom Database Engine is running.

To run the c-tree tutorials from the Linux command line, follow these steps from the same folder you compiled from:

  1. Type the following:

    >make run

  2. The make file will run the tutorial(s).
  3. A prompt will ask you to press <Enter> after each tutorial is run.

If you see a c-tree error, you can look it up in the Error Code Reference.

See the Troubleshooting section below for solutions to common problems.

When running, the first tutorial should look similar to one of the images below:

INIT

Logon to server...

DEFINE

Open table...

Add fields...

Create table...

MANAGE

Delete records...

Add records...

Display records...

1000 Bryan Williams

1001 Michael Jordan

1002 Joshua Brown

1003 Keyon Dooling

DONE

Close table...

Logout...

Press <ENTER> key to exit . . .

See the Compile Using Microsoft Visual Studio IDE section for directions on how to use this tutorial.

Note: On systems running a glibc version older than 2.17, the tutorials need to be linked with librt by adding -lrt to the SYSLIBS macro in the makefile. If you are running a system with glbic older than 2.17, edit the makefile and uncomment -lrt.

Troubleshooting

This section lists some of the errors that can occur when compiling and running these tutorials:

ERROR: [133] - Initialize(): ctdbLogon()

The most common cause of this runtime error is that the FairCom Database Engine is not running. Remember that the c-tree evaluation license times out after 3 hours, so the server might have exited and needs to be re-started. See Setting up the FairCom Database Engine for details.

TOCIndex