User Tools

Site Tools


Say Hello with EEROS

In order to be able to write your own EEROS programs or alter existing example applications, you could use any text editor and use the script on the command line. However, we recommend to use an integrated development environment.


We suggest to use Get the program with

$ apt-get install kdevelop

Create a New Project

  1. Start KDevelop
  2. Create a new C++ project:
    1. Project → New from Template…
    2. Choose Standard/Terminal as project type and type a project name (e.g. test-project).
    3. Create the project by clicking Finish
    4. Create the build configuration. It is recommended to put the target architecture in the name of the build folder. Put the location where EEROS is installed in the “Installation Prefix” field. Important: make sure that this is the location where you have installed EEROS (see Compile). If EEROS is installed globally leave this field blank (not recommended).

Test Program

  1. Copy the following code into “main.cpp”
    #include <iostream>
    #include <eeros/logger/Logger.hpp>
    #include <eeros/logger/StreamLogWriter.hpp>
    int main() {
      using namespace eeros::logger;
      StreamLogWriter w(std::cout);
      Logger log;
   << "Hello, EEROS";
      return 0;
  2. Open CMakeLists.txt file, delete the text written in it and copy/paste the following into it:
    cmake_minimum_required(VERSION 3.5.1)
    find_package(EEROS REQUIRED)
    add_executable(helloworld main.cpp)
    target_link_libraries(helloworld eeros ucl ${CMAKE_DL_LIBS})

    (Note 1: “helloworld” is the name of the dummy-project created for the example. Put your project name where “test-project” is. Note 2: This file is in the project folder, e.g. /home/you/work/helloworld)

  3. Build the project by clicking on the “Build” button up, on the left.

Run the Hello World Program

If you run your test program on the host machine continue below. If you want to do a crossdevelopment, you have to deploy your libraries and test program first. Go to Deploy first before you continue below.

  1. Open a terminal
  2. Navigate to the build folder of your project (e.g. cd /home/you/work/build-x86-64)
  3. Run the program with the command: ./test-project

Use KDevelop with Existing Build Configuration

If you have previously built your application manually or with the aid of the EEROS build scripts, you can import the configuration into KDevelop as follows:

  1. Import the project by choosing the CMakeLists.txt of your project.
  2. Right click on the project and open the project configuration panel.
  3. Choose the build directory of the previously built application as your build directory
  4. Leave the entries for install directory, build type, and extra arguments empty. These settings will be fetched from the existing CMake configuration in your build directory.
  5. Click Ok
  6. Build
getting_started/say_hello.txt · Last modified: 2019/10/15 08:43 by graf