User Tools

Site Tools


getting_started:say_hello

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
getting_started:say_hello [2021/03/25 08:33] – [Create a New Project] ursgrafgetting_started:say_hello [2021/03/25 08:33] – [Test Program] ursgraf
Line 4: Line 4:
  
  
-===== Test Program ===== 
- 
-  - Copy the following code into "main.cpp" <code cpp> 
-#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; 
-} 
-</code> 
-  - Open CMakeLists.txt file, delete the text written in it and copy/paste the following into it: <code cpp> 
-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}) 
-</code> (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)  
-  - Build the project by clicking on the "Build" button up, on the left.  
  
 ===== Run the Hello World Program ===== ===== Run the Hello World Program =====