Skip to content

Runtime SDK Prerequisites#

To write programs using the Runtime SDK a set of tools for compiling and linking programs written in C/C++ is required. For Microsoft Windows, the Runtime SDK comes with support for the Microsoft C/C++ compiler toolchains and in most projects the Microsoft Visual Studio Integrated Development Environment (IDE) will be used.

When using the Linux operating system, the GNU C/C++ and Clang compiler toolchains are supported. These can usually be installed using the package manager that comes with the Linux distribution. Consult the documentation for the Linux distribution, specific online forums and communities.

The code examples in this document generally assume that a modern C++ compiler with support for at least the C++11 standard will be used. If strict C compilation is required, see chapter Considerations When Using Plain C for more information.

Environment#

When installing the runtime, usually an environment variable SISODIR5 is registered with the system, which will be used in the following to denote the location of the runtime installation. Additionally, the platform specific variable SISODIR5_32 or SISODIR5_64 will be registered with the system, and should be used preferably. To keep this documentation platform agnostic, SISODIR5 is used in most places. In screenshots where a specific platform is targeted, the platform specific environment variable will be used.

If the Linux operating system is used, the script setup_siso_env.sh will setup the environment variables and can be added to the startup scripts by the system administrator. Due to the variations in startup used by different distributions, this is not done automatically. If the script is not called automatically when the system is started or a user logs on, you have to source the script manually both to compile and run applications using the Runtime SDK.

Operating System Drivers#

The Runtime SDK needs operating system drivers to access the frame grabbers installed in the computer. On Microsoft Windows, the drivers can be installed using the runtime installer. When using the Linux operating system, the drivers have to be downloaded, compiled and installed separately. Follow the INSTALL document in the Linux driver package for details on how to compile and install the drivers.

Using Microsoft Visual Studio#

When using Microsoft Visual Studio, you can start with a new project and select the "Empty Project" template from the "Visual C++" category. To use the libraries in the project which will be generated, first the directory %SISODIR5%\include should be added to the include paths used by the compiler.

Info

Always make sure that the target platform matches the runtime platform you are using. If you installed the 32-bit runtime, the target platform should be Win32, if you installed the 64-bit runtime, the target platform should be x64. In the following screenshots, the target platform x64 and the platform specific environment variable SISODIR5_64 will be used only as an example for project settings for the 64-bit runtime.

Compiler Settings

Next, the directory %SISODIR5%\lib\visualc should be added to the library paths used by the linker.

Linker Settings

To link against a library in a Microsoft Visual Studio project it has to be added to the dependencies in the linker settings. In the following example the library fglib5.lib is added:

Linker Settings

To add dependencies, you can click on the Drop Down Menu Button, and select <Edit...>.

Using Linux#

When using the Linux operating system and the gcc or clang compilers, the switch -I $SISODIR5/include adds the Runtime SDK include directory to the compiler settings, and the switch -L $SISODIR5/lib adds the Runtime SDK library directory to the linker settings.

To link against a library when using the gcc or clang compilers, the switch -l is used. For example, -l fglib5 adds the library libfglib5.so to the linker dependencies. Given a source code file main.cpp, to compile and link the file into the executable SimpleExample, the following command can be entered on the command line:

g++ -o SimpleExample -I $SISODIR5/include -L $SISODIR5/lib -l fglib5 main.cpp

Using CMake#

CMake is a tool to generate project files from a simple text description of the project requirements for many integrated development environments (IDEs), such as Microsoft Visual Studio, as well as a build workflow using tools like make.

The Runtime SDK comes with files to support the CMake FIND_PACKAGE command. Given a source code file main.cpp, a simple CMakeLists.txt file for a project to compile and link the file into the executable SimpleExample could look like this:

PROJECT(SimpleExample)

FILE(TO_CMAKE_PATH "$ENV{SISODIR5}" SISODIR5)
LIST(APPEND CMAKE_MODULE_PATH "${SISODIR5}/cmake/modules")

FIND_PACKAGE(FgLib5 REQUIRED)

INCLUDE_DIRECTORIES(
    ${FgLib5_INCLUDE_DIR}
)

SET (PRJ_SOURCES
    SimpleExample.cpp
)

ADD_EXECUTABLE(${PROJECT_NAME} ${PRJ_SOURCES})

TARGET_LINK_LIBRARIES(${PROJECT_NAME}
    ${FgLib5_LIBRARIES}
)

Using CMake with Microsoft Visual Studio#

To process the file CMakeLists.txt to generate a project for Microsoft Visual Studio, either the GUI tool can be used, or the project files can be generated by entering on the command line:

cmake -G "Visual Studio 15 2017 Win64" .

Using CMake with make#

To generate a Makefile for the build workflow using make, the following can be entered on the command line:

cmake -G "Unix Makefiles" .
Back to top