Using the API to Write Your Own Application

David Fisher

To use the Indri API on Unix, you will need both the indri library file and all the header files. The installation script puts the library file in prefix/lib/libindri.a and all the header files in prefix/include/. Header files in C have the extension of .h, while a C++ header file has an extension of .hpp.

An application level Makefile that you can use for your own applications has been included. To use it:

   1. Copy from the top level lemur directory to the directory with your application's source code. 
        Edit the file and fill in values for the following:
      OBJS -- list of each of the object files needed to build your application.
      PROG -- name for your application.

   2. Use make -f to build your application.

You will use the Indri library exactly in the same way as you would use any other C++ library. This means you generally do the following:

  • In your C++ code, include the relevant Lemur header files.
  • When compiling your code, use -Iprefix/include as an option so that the compiler can find the included files. (The prefix is as specified when running configure.)
  • When linking your code, use -Lprefix/lib as an option so that the linker can find the Indri library. Also, you need to specify -lindri as a linking option to indicate that you want the Indri library to be linked with your code. See for the list of other libraries that are required to link with -lindri. You may need to be careful about the order of the libraries you specified. The order reflects the assumed dependency among the libraries.


Wiki: Home