Skip to content

Latest commit

 

History

History
114 lines (63 loc) · 2.53 KB

LandingPage.rst

File metadata and controls

114 lines (63 loc) · 2.53 KB

C++-language bindings

This space describes the usage of lib3mf in a C++ host application.

The C++-language bindings come in two different flavors:

Cpp

If you include the header Cpp/lib3mf_implicit.hpp, lib3mf will be loaded dynamically during load-time of your host application through your operating system's mechanism for loading libraries.

Lib3MF::PWrapper wrapper = CWrapper::loadLibrary();

The shared library file lib3mf.*. needs to reside in a path that your operating systems checks when loading libraries.

CppDynamic

If you include the header CppDynamic/lib3mf_dynamic.hpp, Lib3MF will be loaded dynamically during run-time of your host application through an explicit call to

Linux

Lib3MF::PWrapper wrapper = Lib3MF::CWrapper::loadLibrary("LibraryLocation/lib3mf.so");

Mac OSX

Lib3MF::PWrapper wrapper = Lib3MF::CWrapper::loadLibrary("LibraryLocation/lib3mf.dylib");

Windows

Lib3MF::PWrapper wrapper = Lib3MF::CWrapper::loadLibrary("LibraryLocation/lib3mf.dll");

i.e. you need to explicitly provide the location of the shared library file lib3mf.*.

The Lib3MF::PWrapper object provides access to all functionality within lib3mf.

Both flavors of the C++-bindings are header-only which makes it extremly easy to include them into existing projects:

Minimal Example Project

Minimal application code:

Cpp

Lib3MF_example_implicit.cpp

CppDynamic

Lib3MF_example_dynamic.cpp

CMakeLists.txt for minimal project:

Cpp

CMakeLists_implicit.txt

CppDynamic

CMakeLists_dynamic.txt

The examples in the Cpp/CppDynamic-folders of the binary SDK follow exactly this pattern.

The remainder of this space is an in-depth API-reference for the functionality of lib3mf.

General Information

lib3mf lib3mf-types

API-Classes