The Interaction Library SDK is distributed with dynamic 32 bit and 64 bit C++ libraries for Windows, and 64 bit libraries for Linux and macOS. Let's assume we have downloaded a zip file with the SDK version for Windows with a dynamic 64 bit library. We can now unzip this into a directory of our choice, for example C:\src
, so that we there have this content:
We will now build the C++ sample located in samples\cpp
, using the Visual Studio 2017 toolset, to show what C++ header and library files we need.
Using the "x64 Native Tools Command Prompt for VS 2017", this is what we will see when running the compiler without any command line options:
To build the C++ sample file cpp_sample.cpp
, this is the command line we need:
The /I include
option tells the compiler where to find header files included in the sample, specifically interaction_lib/InteractionLib.h
. The /libpath:lib\x64
option tells the linker where to find libraries referenced on the command line, specifically tobii_interaction_lib.lib
and tobii_stream_engine.lib
.
The output from cl.exe
is cpp_sample.exe
, which we now can run from the command line. But first we need to copy the two dynamic libraries from the SDK that the C++ sample references:
If a Tobii eyetracker is plugged into the computer, we will see gaze focus events getting printed to the command window.
The contents of the sample file cpp_sample.cpp
is looked at in detail in the Sample walkthrough