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 make.sh
script on the command line. However, we recommend to use an integrated development environment.
We suggest to use https://www.kdevelop.org/. Get the program with
$ apt-get install kdevelop
#include <iostream> #include <eeros/logger/Logger.hpp> #include <eeros/logger/StreamLogWriter.hpp> int main() { using namespace eeros::logger; Logger::setDefaultStreamLogger(std::cout); Logger log = Logger::getLogger(); log.info() << "Hello, EEROS"; return 0; }
cmake_minimum_required(VERSION 3.5.1) project(helloworld) set(CMAKE_CXX_STANDARD 14) find_package(EEROS REQUIRED) include_directories(${EEROS_INCLUDE_DIR}) link_directories(${EEROS_LIB_DIR}) 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)
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.