Building a C++ Application on Linux and NVIDIA® Jetson
Building a C++ Application on Linux and NVIDIA® Jetson
This section explains how to build an application with the ZED SDK on Linux platforms.

Setting Up a Project
We will build a simple tutorial application Hello ZED using the ZED SDK and CMake. CMake 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, a CMake script can produce Visual Studio projects and solution files.
- Download and install the latest ZED SDK.
- Download the ZED Examples sample code available on our GitHub page. You can also browse our GitHub for additional plugins and sample codes.
- Open the Tutorials/Tutorial - Hello ZED folder to find the code we will build. The following files should be in the directory:
CMakeLists.txtmain.cppREADME.md
Building on Linux and NVIDIA® Jetson
On Linux, compiling an application with the ZED SDK requires a toolchain with GCC (5, 6) and CMake (3.5.0 minimum). To install both, type:
Now let’s build the Hello ZED tutorial.
- Open your terminal and go to the tutorial folder.
- Create a build folder.
- Generate your project with CMake by pointing to the CMakeLists.txt folder (the parent folder).
- Use the
lscommand to check the content of the build directory:
- Compile the application using the
makecommand.
- The application is now compiled. To launch it, run this command:
The application will display your camera serial number in the terminal.

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 between the mode simply enables this option when running the CMake configuration :
Then rebuilt the program :
The size will significantly increase but the ease of deployment will be greatly improved!

