Total Phase provides a set of C examples that demonstrates how the Aardvark API can be integrated into a custom solution. These C examples can be compiled for both Linux and Windows. Below are instructions for building and running these examples.
Getting the Examples
The C examples are part of the large examples package that can be downloaded from the Downloads section of our website.
Downloading and unzip the examples package to a location of your choice. The package contains a directory for each language that is supported by the Aardvark API. The C examples are the only ones covered in this example.
Package Contents
The C examples comprise:
- README.txt with instructions about how to compile and run the examples
- Makefile for Linux and Windows GCC-MinGW32
- Visual C++ workspace for MSVC++ 6.0 and above
- Source files
Building the examples
Note: that in the instructions PROGRAM refers to any of the sample programs provided in the package without the ".c" extension. For example, the aadetect sample program is referred to as "aadetect" and not as "aadetect.c".
Linux
These are the steps for building the examples on Linux.
- Make sure that 'SYSLIBS=-ldl' is uncommented in the Makefile
- Type 'make' at the command line
- To run the program, type the following on the command line '_output/PROGRAM'
Windows Using MinGW
- Install GCC MinGW32.
The latest version can be downloaded from the MinGW website: http://www.mingw.org/ - Install MSYS
The latest version can be downloaded from the MinGW website: http://www.mingw.org/ - Make sure that 'SYSLIBS=' is uncommented in the Makefile
- Type 'make' at the command line
- To run the program, type the following on the command line '_output/PROGRAM'
Windows Visual C++ 6.0
- Open MSVC/Makefile.dsw
- Goto the menu item: Build | Batch Build.... This will open a dialog window with all examples programs.
- Make sure the desired examples are checked and click Build
- To run the program, open a command line and change directory to the "c" directory. To run the command, type the following on the command line '_output/PROGRAM'
If an error occurs when executing an example
The C examples have been thoroughly tested, so there is a very small chance that a bug will cause an error.
The most common reason that users encounter an error is that the program needs to be executed from the "c" directory is because the aardvark.dll library is located in the c directory. If the DLL is copied to the _output directory, then the examples can executed from the "_output" directory directly.