File Content Extraction 25.2
Filter SDK C++ Programming Guide

# Introduction

The C++ sample programs demonstrate basic usage of the C++ implementation of the Filter API. The sample code is intended to provide a starting point for your own more advanced applications or to be used for reference purposes.

The sample programs share a single header, to assist with parsing command-line arguments.

The source code for the programs is in the directory `cppapi\samples\src`.

The executable for the programs is in the directory `install\KeyviewFilterSDK\OS\bin`, where `OS` is the name of the operating system.

## Build the Sample Programs

To build the sample programs, you must add your license key to the source code.

To add your license key

1. Open the file `cppapi/samples/src/KeyView_License.hpp`.

2. Find the text `YOUR_KEYVIEW_LICENSE` and replace it with a string literal that contains your license key.

The following sections describe how to build the sample program on Windows and Linux platforms.

### Windows

NOTE: To build the sample programs on Windows, you need at least Microsoft Visual Studio 2015.

To build the sample programs on Windows

1. At the Visual Studio command prompt, switch to the `cppapi/samples/bin/` directory and run the following command:

   `nmake -f Makefile`

   The sample programs are created in the `bin` directory.

### Linux

To build the sample programs on Linux

1. Switch to the `cppapi/samples/bin` directory.

2. Run the appropriate command:

   GCC 5

   `export CXXFLAGS="-std=c++11"
   make`

   GCC 6

   `make`

   The sample programs are created in the `bin` directory.

## Run the Sample Programs

You can run a sample program with no arguments to view command-line help. For example:

    cppapi/samples/bin$ ./detect
    Basic usage: ./detect [options] input_file

    Options:
    --bin_path <path>    Path to FilterSDK bin directory
    --tmp_dir <path>     Path to temporary directory

    Boolean Options:
    --ip                 Run in process
    --oop_log            Create out-of-process log
    --oop_log_mem        Add memory error information to the out-of-process log

All the sample programs have options that take a required value, and Boolean options that toggle behavior. The programs contain simple argument parsing logic to detect invalid usage.

You must provide each sample program with the path to the Filter SDK `bin` directory where the File Content Extraction dynamic libraries are stored. If you specify the `bin` directory incorrectly, the sample program prints a message indicating that the `kvfilter` library could not be loaded. The `bin_path` argument defaults to the current directory.

The following C++ sample programs are provided:

- detect
- extract
- filter_container
- filter_document
- metadata
- subfiles

Copyright 1997-2025 Open Text
Version 25.2 | Last updated April 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: File Content Extraction 25.2

Topic Title: Introduction