> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.stereolabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.stereolabs.com/_mcp/server.

# Building a C++ Application on Linux and NVIDIA® Jetson

This section explains how to build an application with the ZED SDK on Linux platforms.

![image](/_fern-img/7945fbae07f8e09238b917b7ad12836f2301077f3de77a82624d148b6e99fee8.webp)

## Setting Up a Project

We will build a simple tutorial application **Hello ZED** using the ZED SDK and CMake. [CMake](https://cmake.org) is a cross-platform project generation tool. It provides an easy way to build project files that can be used in the compiler environment of your choice. For example, on Linux a CMake script can produce Makefiles or Ninja build files.

* Download and install the latest [ZED SDK](https://www.stereolabs.com/developers/release/).
* Download the [ZED Examples](https://github.com/stereolabs/zed-sdk/archive/master.zip) sample code available on our [GitHub](https://github.com/stereolabs/zed-sdk) page. You can also browse our GitHub for additional plugins and sample codes.
* Open the *tutorials/tutorial 1 - hello ZED/cpp* folder to find the code we will build. The following files should be in the directory:
  * `CMakeLists.txt`
  * `main.cpp`
  * `README.md`

## Building on Linux and NVIDIA® Jetson

On Linux, compiling an application with the ZED SDK requires a C++17 toolchain (since ZED SDK 5.1), such as [GCC](https://gcc.gnu.org/) 9 or newer (the default toolchain of Ubuntu 22.04 and later), and [CMake](https://cmake.org) (3.5.0 minimum). To install both, type:

```bash
sudo apt-get install build-essential cmake
```

Now let's build the Hello ZED tutorial.

* Open your terminal and go to the tutorial folder.

```bash
cd path/to/your/project/ZED_Tutorial_1
```

* Create a build folder.

```bash
mkdir build && cd build
```

* Generate your project with CMake by pointing to the CMakeLists.txt folder (the parent folder).

```bash
cmake ..
...
-- Configuring done
-- Generating done
-- Build files have been written to: path/to/your/project/ZED_Tutorial_1/build
```

* Use the `ls` command to check the content of the build directory:

```bash
ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake Makefile
```

* Compile the application using the `make` command.

```bash
make
```

* The application is now compiled. To launch it, run this command:

```bash
./ZED_Tutorial_1
```

The application will display your camera serial number in the terminal.

![image](/_fern-img/7945fbae07f8e09238b917b7ad12836f2301077f3de77a82624d148b6e99fee8.webp)

## Dynamic/static linking

On Linux, the ZED SDK is available as static and dynamic libraries. The default is dynamic, reducing the application size but forcing the application user to install all the dependencies.

The static linking will package all the dependencies into the final executable.

To switch to static linking, set this option when running the CMake configuration:

```bash
cmake -DLINK_SHARED_ZED=OFF ..
```

Then rebuild the program:

```bash
make
```

The size will significantly increase but the ease of deployment will be greatly improved!