Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.66 KB

cpp_project.rst

File metadata and controls

42 lines (31 loc) · 1.66 KB

Link Open3D in C++ projects

CMake

We provide two example CMake projects to demonstrate how to use Open3D in your CMake projects.

You may download Open3D library binaries for common platform and build configurations from GitHub releases. For instructions on how to compile Open3D from source, checkout :ref:`compilation`.

pkg-config

If you don't use the CMake build system in your project, you can use the simpler pkg-config tool to get the build settings needed to link it with Open3D. This is available on Linux and macOS, if you use Open3D shared libraries. Note that we recommend using CMake over pkg-config, since the latter cannot properly account for complex build configurations.

For example, you can equivalently build the Draw executable from the above example project with this command:

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:<Open3D_install_path>/lib/pkgconfig"
c++ Draw.cpp -o Draw $(pkg-config --cflags --libs Open3D)

pkg-config reads .pc files included in the Open3D install and fills in the required build options. Note that the pkg-config --libs options must appear after your source files to avoid unrecognized symbol linker errors.