getting_started:write_app:use_on_host
This is an old revision of the document!
Writing EEROS Applications for the Host
Say Hello with EEROS
- Create a project directory within your EEROS project directory and change into it with
$ mkdir hello $ cd hello
- Create a text file “main.cpp” and copy the following code into it
#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; }
- Create a text file “CMakeLists.txt” and copy the following text into it:
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})
- Create a build directory for your new project and change into it with
$ mkdir ../build-x86/hello $ cd ../build-x86/hello $ cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 ../../hello $ make
Continue with Working on the Host.
Use Existing Project
As an example we use the Control a Single Motor demo program.
- Fetch the code of the application from within your EEROS directory with
$ git clone
- Build the project with
$ ./make.sh
Continue with Working on the Host.
getting_started/write_app/use_on_host.1616655099.txt.gz · Last modified: 2021/03/25 07:51 by ursgraf