getting_started:tutorials:helloworld
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
getting_started:tutorials:helloworld [2015/09/23 13:43] – [Preparation] graf | getting_started:tutorials:helloworld [2018/11/13 10:25] (current) – removed graf | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Getting started with the EEROS robotics framework ====== | ||
- | ==== Preparation ==== | ||
- | - Setup an development environment as desribed [[getting_started: | ||
- | - Start KDevelop | ||
- | - Create a new C++ project: | ||
- | - Project -> New from Template... | ||
- | - Choose Standard/ | ||
- | - Create the project by clicking Finish | ||
- | - Follow the instructions to create the build directory with the given default settings. Check that the build folder is within the project folder and then click OK. {{ : | ||
- | - Check the build sequence on the left bottom of Kdevelop. " | ||
- | - Build the project with the build button. | ||
- | ==== Say Hello World with EEROS ==== | ||
- | |||
- | 1. Copy the following code into " | ||
- | |||
- | <code cpp> | ||
- | #include < | ||
- | #include < | ||
- | #include < | ||
- | |||
- | int main() { | ||
- | using namespace eeros:: | ||
- | |||
- | StreamLogWriter w(std:: | ||
- | Logger< | ||
- | Logger< | ||
- | |||
- | log.info() << " | ||
- | |||
- | return 0; | ||
- | } | ||
- | </ | ||
- | |||
- | 2. Open CMAkeLists.txt file, delete the text written on it and copy the following: | ||
- | (Note 1: " | ||
- | |||
- | <code cpp> | ||
- | cmake_minimum_required(VERSION 2.8) | ||
- | |||
- | project(test-project) | ||
- | |||
- | include_directories(${ADDITIONAL_INCLUDE_DIRS}) | ||
- | link_directories(${ADDITIONAL_LINK_DIRS}) | ||
- | |||
- | set(CMAKE_CXX_FLAGS " | ||
- | |||
- | add_executable(test-project main.cpp) | ||
- | |||
- | target_link_libraries(test-project eeros) | ||
- | </ | ||
- | |||
- | 3. Open CMakeCache.txt file and add the following: | ||
- | (Note 1: This file is in the build folder, in the project folder. e.g. / | ||
- | |||
- | <code cpp> | ||
- | ADDITIONAL_INCLUDE_DIRS: | ||
- | ADDITIONAL_LINK_DIRS: | ||
- | </ | ||
- | |||
- | See example: | ||
- | |||
- | {{ : | ||
- | |||
- | 4. Build the project by clicking on the " | ||
- | |||
- | ==== Run the Hello World Program ==== | ||
- | |||
- | - Open a terminal | ||
- | - Navigate until the build folder of your project (e.g. cd / | ||
- | - Run the program with the command: ./ | ||
- | |||
- | {{ : |
getting_started/tutorials/helloworld.1443008589.txt.gz · Last modified: 2015/09/23 13:43 (external edit)