Difference between revisions of "Cpp2"
(Created page with "==Introduction== {|cellspacing="20" cellpadding="10" |- style="vertical-align:top" |Image:Robotino_cpp_icon_64.png | The second version of the application programming inte...") |
(→Using API2 with Linux, gcc and cmake) |
||
(19 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
[[downloads#API2|API2 binary package]] | [[downloads#API2|API2 binary package]] | ||
|} | |} | ||
+ | |||
+ | ==Using API2 with Visual Studio 2010 and cmake== | ||
+ | * Install Visual Studio. | ||
+ | * Install [http://cmake.org/cmake/resources/software.html cmake]. | ||
+ | * If you want to build the examples with grafical user interface also install [http://qt.nokia.com/downloads/downloads#qt-lib Qt4]. | ||
+ | * Install the appropriate [[downloads#API2|API2 binary package]]. | ||
+ | |||
+ | In order to be able to modify the C++ examples shipping with the robotino_api2 package copy the folder holding the c++ examples from the installation directory to your user directory. This is a must for users of Windows Vista or later. | ||
+ | :C:\Program Files\REC GmbH\robotino\api2\examples\c++ -> C:\Users\yourprofile\Documents | ||
+ | |||
+ | ===Build and run the (non-gui) circle example=== | ||
+ | |||
+ | Now use cmake (cmake-gui) to generate a Visual Studio project from the CMakeLists.txt in each example folder. Put in the correct path to the source code | ||
+ | : C:/Users/yourprofile/Documents/c++/circle | ||
+ | Select a path where to generate the Visual Studio files to | ||
+ | : C:/Users/yourprofile/Documents/build/c++/circle | ||
+ | |||
+ | Click configure. You'll be ask for the compiler you are going to use. Select Visual Studio 10 here. After configuration completed click Generate to generate the Visual Studio project. | ||
+ | |||
+ | Go to the build directory specified in the cmake GUI and launch the Visual Studio Solution by double-clicking the *.sln file. Build the example. Before running it you have to set Robotino's IP address in the Debugging property page. | ||
+ | |||
+ | <gallery> | ||
+ | Cpp2_copy_examples.png|Copy examples to user directory | ||
+ | Cpp2_cmake_gui_select_source_and_build.png|Select source and build directory | ||
+ | Cpp2_cmake_gui_select_compiler.png|Select compiler | ||
+ | Cpp2_cmake_gui_configured.png|Successfull configuration | ||
+ | Cpp2_launch_solution.png|Launch solution | ||
+ | Cpp2_circle_set_debugging_property.png|Set Robotino's IP address. | ||
+ | </gallery> | ||
+ | |||
+ | ===Build and run GUI camera example=== | ||
+ | After installing Qt set the environment variable QTDIR pointing to the directory you installed Qt into. This is neccessary for cmake to find the Qt includes and libraries. Use cmake-gui to create the Visual Studio Solution. Build and run the application. | ||
+ | |||
+ | <gallery> | ||
+ | Cpp2_windows_set_qtdir.png|Set QTDIR | ||
+ | Cpp2_circle_gui_cmake_gui.png|Cmake GUI found Qt | ||
+ | Cpp2_circle_gui_launch_solution.png|Launch solution | ||
+ | Cpp2_circle_gui_vs_build.png|Build the example | ||
+ | Cpp2_circle_gui_running.png|Running the example | ||
+ | </gallery> | ||
+ | |||
+ | ==Using API2 with Linux, gcc and cmake== | ||
+ | * Install the appropriate [[downloads#API2|API2 binary package]] |
Latest revision as of 16:25, 29 November 2019
Contents
Introduction
Using API2 with Visual Studio 2010 and cmake
- Install Visual Studio.
- Install cmake.
- If you want to build the examples with grafical user interface also install Qt4.
- Install the appropriate API2 binary package.
In order to be able to modify the C++ examples shipping with the robotino_api2 package copy the folder holding the c++ examples from the installation directory to your user directory. This is a must for users of Windows Vista or later.
- C:\Program Files\REC GmbH\robotino\api2\examples\c++ -> C:\Users\yourprofile\Documents
Build and run the (non-gui) circle example
Now use cmake (cmake-gui) to generate a Visual Studio project from the CMakeLists.txt in each example folder. Put in the correct path to the source code
- C:/Users/yourprofile/Documents/c++/circle
Select a path where to generate the Visual Studio files to
- C:/Users/yourprofile/Documents/build/c++/circle
Click configure. You'll be ask for the compiler you are going to use. Select Visual Studio 10 here. After configuration completed click Generate to generate the Visual Studio project.
Go to the build directory specified in the cmake GUI and launch the Visual Studio Solution by double-clicking the *.sln file. Build the example. Before running it you have to set Robotino's IP address in the Debugging property page.
Build and run GUI camera example
After installing Qt set the environment variable QTDIR pointing to the directory you installed Qt into. This is neccessary for cmake to find the Qt includes and libraries. Use cmake-gui to create the Visual Studio Solution. Build and run the application.
Using API2 with Linux, gcc and cmake
- Install the appropriate API2 binary package