You're reading the documentation for a development version. For the latest released version, please have a look at Jazzy.
Building a package with Eclipse 2021-06
You cannot create a ROS 2 package with eclipse, you need to create it with commandline tools. Follow the Create a package tutorial.
After you created your project, you can edit the source code and build it with eclipse.
We start eclipse and select a eclipse-workspace.
![eclipse_work_dir](../../_images/eclipse_work_dir.png)
We create a C++ project
![eclipse_create_c++_project](../../_images/eclipse_create_c%2B%2B_project.png)
![eclipse_c++_project_select_type](../../_images/eclipse_c%2B%2B_project_select_type.png)
We see that we got C++ includes.
![eclipse_c++_project_includes](../../_images/eclipse_c%2B%2B_project_includes.png)
We now import our ROS 2 project. The code is still in the old place.
![eclipse_import_project](../../_images/eclipse_import_project.png)
![eclipse_import_filesystem](../../_images/eclipse_import_filesystem.png)
Click the Advanced in the Options and check the Create links in worksapce.
![eclipse_import_select_my_package](../../_images/eclipse_import_select_my_package.png)
We see in the source code that the C++ includes got resolved but not the ROS 2 ones.
![eclipse_c++_wo_ros_includes](../../_images/eclipse_c%2B%2B_wo_ros_includes.png)
![eclipse_c++_path_and_symbols](../../_images/eclipse_c%2B%2B_path_and_symbols.png)
Add include paths of needed packages. (e.g. /opt/ros/iron/include/rclcpp, /opt/ros/iron/include/std_msgs, etc.)
![eclipse_c++_add_directory_path](../../_images/eclipse_c%2B%2B_add_directory_path.png)
We now see that the ROS 2 includes got resolved too.
![eclipse_c++_indexer_ok](../../_images/eclipse_c%2B%2B_indexer_ok.png)
Adding Builder colcon, so that we can build with right-click on project and “Build project”.
![eclipse_c++_properties_builders](../../_images/eclipse_c%2B%2B_properties_builders.png)
![eclipse_c++_builder_main](../../_images/eclipse_c%2B%2B_builder_main.png)
With PYTHONPATH you can also build python projects.
![eclipse_c++_builder_env](../../_images/eclipse_c%2B%2B_builder_env.png)
![eclipse_c++_properties_builders_with_colcon](../../_images/eclipse_c%2B%2B_properties_builders_with_colcon.png)
Right-click on the project and select “Build Project”.
![eclipse_c++_build_project_with_colcon](../../_images/eclipse_c%2B%2B_build_project_with_colcon.png)