The Interaction Library SDK is distributed with dynamic 32 bit and 64 bit C libraries for Windows, and 64 bit C 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\c
, 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 c_sample.c
, 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_c.h
. The /libpath:lib\x64
option tells the linker where to find libraries referenced on the command line, specifically tobii_interaction_lib_c.lib
.
The output from cl.exe
is c_sample.exe
, which we now can run from the command line. But first we need to copy the 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.
Please note, when building with gcc, you may have to explicitely make sure pthreads gets linked, like so:
The contents of the sample file c_sample.c
is looked at in detail in the Sample walkthrough