Hide menu
Loading...
Searching...
No Matches
Building C++ Examples

C++ examples are located in the subfolder examples/cxx.

Note
Save the license key file you received for your evaluation program as ${install_dir}/examples/cxx/mtk_license.cxx. When you become a customer you will substitute it with a commercial license key.

Building

C++ examples are provided with cmake-based configuration files. To build examples download the cmake tool from cmake.org.

Building with Microsoft Visual Studio on Windows

To build C++ examples open cmake-gui, choose the example's subdirectory, choose build directory and press "Configure" button.

Next specify required Visual Studio version (e.g. Visual Studio 15 2017 Win64).

When configuring has been done press "Generate" button.

This will create Visual Studio project and solution files in the build subdirectory.

Building with GNU Makefiles

To build an example on Linux or MacOS with the help of GNU make, use respective generator with cmake:

cd /dev/manufacturingtoolkit/1.0.0/examples/cxx/
mkdir build
cmake -H. -Bbuild -G "Unix Makefiles"
cmake --build build
Note
To get the list of supported generators invoke cmake --help.
To build a debug configuration add the switch -DCMAKE_BUILD_TYPE=Debug.

To run built examples, you should add the path to Manufacturing Toolkit dynamic libraries directory to the environment variable LD_LIBRARY_PATH on Linux and DYLD_LIBRARY_PATH on MacOS.

Note
Pay attention that you need to set respective directories depending on your particular configuration, including target architecture (x86 or x64), compiler (e.g. gcc4 or clang7), and mode (release or debug).

Recommended compiler options

Manufacturing Toolkit should work out of the box with the standard compiler options. Exception support should be enabled to ensure their proper handling (/EHa or /EHsc flags in MSVC, -fexceptions in Clang and GCC).