getting_started:say_hello
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| getting_started:say_hello [2019/10/22 10:10] – [Create a New Project] graf | getting_started:say_hello [2021/03/25 08:33] (current) – removed ursgraf | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Say Hello with EEROS ====== | ||
| - | In order to be able to write your own EEROS programs or alter existing example applications, | ||
| - | ===== Preparation ===== | ||
| - | We suggest to use [[https:// | ||
| - | < | ||
| - | $ apt-get install kdevelop | ||
| - | </ | ||
| - | |||
| - | ===== Create a New Project ===== | ||
| - | - Start KDevelop | ||
| - | - Create a new C++ project: | ||
| - | - Project -> New from Template... | ||
| - | - Choose Standard/ | ||
| - | - Create the project by clicking Finish | ||
| - | - 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 " | ||
| - | ===== Test Program ===== | ||
| - | |||
| - | - Copy the following code into " | ||
| - | #include < | ||
| - | #include < | ||
| - | #include < | ||
| - | |||
| - | int main() { | ||
| - | using namespace eeros:: | ||
| - | |||
| - | StreamLogWriter w(std:: | ||
| - | Logger log; | ||
| - | log.set(w); | ||
| - | |||
| - | log.info() << " | ||
| - | |||
| - | return 0; | ||
| - | } | ||
| - | </ | ||
| - | - 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}) | ||
| - | </ | ||
| - | - Build the project by clicking on the " | ||
| - | |||
| - | ===== Run the Hello World Program ===== | ||
| - | If you run your test program on the host machine continue below. | ||
| - | If you want to do a crossdevelopment, | ||
| - | - Open a terminal | ||
| - | - Navigate to the build folder of your project (e.g. cd / | ||
| - | - Run the program with the command: ./ | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | ===== Use KDevelop with Existing Build Configuration ===== | ||
| - | If you have previously built your application manually or with the aid of the [[getting_started: | ||
| - | - Import the project by choosing the '' | ||
| - | - Right click on the project and open the project configuration panel. | ||
| - | - Choose the build directory of the previously built application as your build directory | ||
| - | - 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. | ||
| - | - Click '' | ||
| - | - Build | ||
getting_started/say_hello.1571731853.txt.gz · Last modified: 2019/10/22 10:10 by graf
                
                