Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2025.2

# Overview

This section provides information on release compatibility, purpose, and architecture of the API.

## Release compatibility of the API

The P4 API for C/C++ is subject to change from release to release, and is not guaranteed to be source-code compatible from one release to the next. However, applications that you create using the API can run against previous releases of P4 Server and should also run against later releases of P4 Server.

Support for specific features depends on the version of P4 Server and the API that you use.

## Purpose of the API

The P4 API for C/C++ enables you to create applications that:

- Interact with end users.
- Send commands to the P4 Server.
- Process the data the P4 Server returns.

## Architecture of the API

The client session is managed by a C++ class called `ClientApi`. (See ClientApi methods)

User interaction is channeled through the `ClientUser` C++ class. The default methods of `ClientUser` implement the `p4` command line interface. To create a custom client application, create a subclasses of `ClientUser`. (See ClientUser methods)

## Types of API files

The P4 API for C/C++ consists of:

- header files (.h), which are in the include/p4 subdirectory
- platform-specific link libraries in the lib subdirectory
- reference implementation of the `ClientUser` class, clientuser.cc, which is in the sample subdirectory

## Downloading the API archive

The API is packaged as an .tgz or .zip file. To download for your platform, go to Download Helix Core C/C++ API

## Compatibilities and version requirements

The P4API source code is compatible with the C++98 language standard, except for the optional Helix Core Extensions (see P4 Extensions Documentation), which requires C++17.

The pre-built API distributions require either OpenSSL 1.0 or OpenSSL 1.1. The version of OpenSSL the API requires is in its file name. For example, p4api_vs2013_dyn_openssl1.1.1.zip requires the 1.1 version.

Similarly, versions must match for Windows VisualStudio.

For Linux platforms, the GLIBC version compatibility is part of the file name. For example, p4api-glibc2.12-openssl1.1.1.tgz was built with 1.1

For Extensions-compatible builds, the libstdc++ version must be at least GLIBCXX_3.4.22

For non-Windows platforms, the Pthreads library must be available.

Your search for returned results