getting_started:say_hello
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
getting_started:say_hello [2019/10/14 10:14] – [Run the Hello World Program] graf | getting_started:say_hello [2021/02/12 17:16] – [Create a New Project] ursgraf | ||
---|---|---|---|
Line 12: | Line 12: | ||
- Create a new C++ project: | - Create a new C++ project: | ||
- Project -> New from Template... | - Project -> New from Template... | ||
- | - Choose Standard/ | + | - Choose Standard/ |
- Create the project by clicking Finish | - 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 " | + | - 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 ===== | ===== Test Program ===== | ||
Line 26: | Line 25: | ||
using namespace eeros:: | using namespace eeros:: | ||
- | | + | |
- | Logger log; | + | Logger log = Logger:: |
- | log.set(w); | + | |
log.info() << " | log.info() << " | ||
Line 37: | Line 35: | ||
- Open CMakeLists.txt file, delete the text written in it and copy/paste the following into it: <code cpp> | - 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) | cmake_minimum_required(VERSION 3.5.1) | ||
- | project(test-project) | + | project(helloworld) |
set(CMAKE_CXX_STANDARD 14) | set(CMAKE_CXX_STANDARD 14) | ||
find_package(EEROS REQUIRED) | find_package(EEROS REQUIRED) | ||
- | include_directories(${EEROS_INCLUDE_DIR}; | + | include_directories(${EEROS_INCLUDE_DIR}) |
- | link_directories(${EEROS_LIB_DIR}; | + | link_directories(${EEROS_LIB_DIR}) |
- | add_executable(test-project | + | add_executable(helloworld |
- | target_link_libraries(test-project | + | target_link_libraries(helloworld |
- | </ | + | </ |
- Build the project by clicking on the " | - Build the project by clicking on the " | ||
===== Run the Hello World Program ===== | ===== Run the Hello World Program ===== | ||
If you run your test program on the host machine continue below. | If you run your test program on the host machine continue below. | ||
- | If you want to do a crossdevelopment, | + | If you want to do a crossdevelopment, |
- Open a terminal | - Open a terminal | ||
- | - Navigate to the build folder of your project (e.g. cd /home/abajric/work/build-test-project-x86-64) | + | - Navigate to the build folder of your project (e.g. cd /home/you/ |
- Run the program with the command: ./ | - 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 EEROS build scripts ([[https:// | ||
- | - 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 |