Web Analytics Made Easy - Statcounter
Skip to content

Building on Linux#

This guide shows how to build a SAMSON Extension on Linux with Qt Creator and CMake.

Use it after you have already installed the SDK and generated an extension workspace. The goal is to configure the root CMake project, build the install target, and run the matching SAMSON executable from the IDE.

Requirements#

If you have not installed the SAMSON SDK yet, complete Installation first.

  • gcc/g++ 5.4 or newer
  • CMake 4.0 or newer
  • Qt 6.10.2
  • Qt Creator or another IDE you prefer

Qt Creator is the workflow described below because it matches the generated project layout and the Qt-based extension workflow well.

Configuration of a project in Qt Creator#

Open Qt Creator and choose Open Project... or File > Open File or Project... (Ctrl+O).

Select the root CMakeLists.txt file in the extension workspace. Use the root workspace file, not the CMakeLists.txt inside one specific extension folder.

Choose the root CMakeLists.txt

Configure Project#

  1. Choose the default kit, for example Desktop Qt 6.10.2 GCC 64 bit.
  2. Expand Details.
  3. Configure both build directories: - Debug: PathToExtensions/build/Debug - Release: PathToExtensions/build/Release
  4. Click Configure Project.

Configure Project

You may see errors initially because CMake variables still need to be added. Switch to Projects mode (Ctrl+5) to finish the configuration.

Build Settings#

CMake configuration#

Add the variables that the generated extension workspace expects:

  1. Add a string variable named SAMSON_SDK_PATH and set it to: $HOME/OneAngstrom/SAMSON-Sdks/11.0.0
  2. Add a boolean variable named DEBUG. - Set it to ON for the Debug configuration - Leave it OFF for the Release configuration
  3. Click Re-configure with Initial Parameters and confirm the reconfiguration.

CMake configuration

Build Steps#

To ensure the built extension is installed automatically:

  1. Scroll to Build Steps
  2. Expand the step details
  3. Enable the install option

Build steps: add the install option

Build#

Open the Edit view to inspect the project tree, then build the project with Ctrl+B or Build > Build Project "SAMSON-Elements".

Checkpoint:

  • the build finishes successfully
  • the install step runs
  • the extension is copied into the correct SAMSON location

Note

Building the install target automatically builds the project if needed.

Note

If the extension does not compile, you may need the 64-bit development and static packages for libstdc++.

Run Settings#

Debug and Release extensions must be run against different SAMSON executables:

  • Debug: the SAMSON Debug executable from the SDK
  • Release: the normal SAMSON application executable

In Projects mode (Ctrl+5), create one run configuration for each build configuration and set the executable:

$HOME/OneAngstrom/SAMSON-Sdks/11.0.0/SAMSON-Debug/Binaries/SAMSON-Core-Console

$HOME/Applications/SAMSON.app/11.0.0/Binaries/SAMSON-Core-Console

Important

Replace $HOME with the actual path to your user directory.

Then set the environment variables needed to locate Qt and SAMSON runtime libraries:

LC_ALL=en_US.UTF-8
LD_LIBRARY_PATH=$HOME/Qt/6.10.2/gcc_64/lib:$HOME/OneAngstrom/SAMSON-Sdks/11.0.0/SAMSON-Debug/Binaries
LC_ALL=en_US.UTF-8
LD_LIBRARY_PATH=$HOME/Qt/6.10.2/gcc_64/lib:$HOME/OneAngstrom/SAMSON/11.0.0/Binaries

Run configuration: environment

Run#

Once the run settings are configured:

  1. build with Ctrl+B
  2. run with Ctrl+R
  3. verify that SAMSON starts and your extension is loaded

Tip

If you use Debug for both build and run, you can set breakpoints and debug the extension directly from Qt Creator.

Adding files to a SAMSON Extension#

When you add or remove source files, classes, or resources, regenerate the project by:

  • rerunning CMake, or
  • making a small change to the relevant CMakeLists.txt file and letting Qt Creator trigger reconfiguration automatically on the next build

Adding new SAMSON Extensions to the project#

If you generate new extensions in the same workspace, the Extension Generator updates the root CMakeLists.txt through ADD_SUBDIRECTORY. The next CMake reconfiguration should add the new extension targets automatically.

Compatibility with older Linux distributions#

SAMSON supports Linux distributions with GLIBC 2.17 or newer. Check your local GLIBC version with:

ldd --version

If you want your extension to run on older supported Linux distributions even when you build it on a newer system, SAMSON SDK provides SBCSystemDefinitions.hpp. This header forces linking against compatibility symbols not newer than GLIBC 2.17 for selected cases.

In many extensions it is already included indirectly. If you use external code or external libraries that require it, include it explicitly:

#include "SBCSystemDefinitions.hpp"

To inspect which GLIBC symbols your extension currently depends on, run:

objdump -T UUID.so | grep GLIBC

where UUID.so is the built extension library.

When it is useful

This matters when you build on a recent distribution but want the extension to remain loadable on older distributions with supported GLIBC versions.

Troubleshooting#

  • If configuration fails, verify SAMSON_SDK_PATH and the selected Qt kit.
  • If the extension builds but does not load, check that the run configuration matches the build configuration.
  • If Qt Creator shows stale targets, force a CMake reconfiguration.

If you have questions or issues, use the SAMSON Connect Forum or contact us.

Next steps#