# No such file or directory : geometry\_msgs/Point32

**URL:** <https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127>\
**Category:** ROS2 Basics in 5 Days Humble (C++)\
**Tags:** error, ros2\
**Created:** [February 29, 2024, 4:57am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127 "2024-02-29T04:57:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![reiko.iwamoto](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/reiko.iwamoto/32/7933_2.png) [@reiko.iwamoto](https://get-help.theconstruct.ai/u/reiko.iwamoto)\
**Post date:** [February 29, 2024, 4:57am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/1 "2024-02-29T04:57:24Z")

</div>

Hi Construct Team,  
I have a trouble to compile action interface:

```auto
---
geometry_msgs/Point32[] list_of_odoms
---
float32 current_total

```

I read **this post** : [colcon build fails - environment dependency requirement](https://get-help.robotigniteacademy.com/t/rosds-colcon-build-fails-environment-dependency-requirement/19994)  
to solve this issue (removed **msg** from the address).

However, another error occurred:

```auto
fatal error: geometry_msgs/msg/detail/point32__struct.hpp: No such file or directory
  127 | #include "geometry_msgs/msg/detail/point32__struct.hpp"

```

.  
But this file exists and I accessed to see whats going on.  
And saw this clang error : **not\_found**  
This seems to affect following code either as you can see below.

 ![image](https://get-help.robotigniteacademy.com/uploads/default/original/2X/c/c43ead75cd8dc99ada6f846cfea8f3e47d153e7b.png)

.  
I also checked `geometry_msgs/msg/detail/point__struct.hpp`  
which is very similar to that point32 file.  
And this file doesnt have any issue to link cpp files.

 ![image](https://get-help.robotigniteacademy.com/uploads/default/original/2X/0/0dd4d4eb80c09f27192605b1bc45c58c42556aa6.png)  
.  
Not sure if the clang error caused a build error of action interface.  
Could you have a look?

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [February 29, 2024, 5:05am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/2 "2024-02-29T05:05:25Z")

</div>

Hi @reiko.iwamoto ,

Please don’t consider the error warnings produced by the IDE. The IDE cannot find certain files and functions even if they are defined and present. The only errors you should take into notice are the ones produced during `colcon build`.

You can not and should not change any installed files. So knowing those files are present is good, but trying to make any changes to those files would be a bad idea.

What error does your `colcon build` report? Could you copy-paste the complete compilation error outputs here?  
Also, please post your `CMakeLists.txt` file contents as a Markdown formatted text.

You can use `Pose2D` instead of `Point` or `Point32` message type.

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![reiko.iwamoto](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/reiko.iwamoto/32/7933_2.png) [@reiko.iwamoto](https://get-help.theconstruct.ai/u/reiko.iwamoto)\
**Post date:** [February 29, 2024, 5:12am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/3 "2024-02-29T05:12:31Z")

</div>

Hi @girishkumar.kannan,  
Yup, i thought it would be very bad idea to touch these files.  
So no worries, i did care very much about no change.  
Below is the whole error message i got:

```auto
user:~/ros2_ws$ colcon build --packages-select rosject_msg
Starting >>> rosject_msg
--- stderr: rosject_msg
In file included from /home/user/ros2_ws/build/rosject_msg/rosidl_typesupport_introspection_cpp/rosject_msg/action/detail/odom_record__type_support.cpp:12:
/home/user/ros2_ws/build/rosject_msg/rosidl_generator_cpp/rosject_msg/action/detail/odom_record __struct.hpp:127:10: fatal error: geometry_msgs/msg/detail/point32__ struct.hpp: No such file or directory
  127 | #include "geometry_msgs/msg/detail/point32__struct.hpp"
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/rosject_msg __rosidl_typesupport_introspection_cpp.dir/build.make:119: CMakeFiles/rosject_msg__ rosidl_typesupport_introspection_cpp.dir/rosidl_typesupport_introspection_cpp/rosject_msg/action/detail/odom_record__type_support.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:369: CMakeFiles/rosject_msg__rosidl_typesupport_introspection_cpp.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< rosject_msg [3.42s, exited with code 2]

Summary: 0 packages finished [3.67s]
  1 package failed: rosject_msg
  1 package had stderr output: rosject_msg
user:~/ros2_ws$

```

CMakeLists is following:

```auto
cmake_minimum_required(VERSION 3.8)
project(rosject_msg)

# Default to C99
if(NOT CMAKE_C_STANDARD)
  set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(action_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  "srv/FindWall.srv"
  "action/OdomRecord.action"
)

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # comment the line when a copyright and license is added to all source files
  set(ament_cmake_copyright_FOUND TRUE)
  # the following line skips cpplint (only works in a git repo)
  # comment the line when this package is in a git repo and when
  # a copyright and license is added to all source files
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()

```

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [February 29, 2024, 5:17am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/4 "2024-02-29T05:17:03Z")

</div>

Hi @reiko.iwamoto ,

I think you have forgotten to include `geometry_msgs` as a dependency in your `rosject_msg` package.  
Also include `geometry_msgs` and `nav_msgs` as dependencies to your main package.

You need to edit the `CMakeLists.txt` and `package.xml` files of each package to include the above dependencies.

That should solve your problem. Let me know if you still have issues after doing the above steps in this post.

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![reiko.iwamoto](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/reiko.iwamoto/32/7933_2.png) [@reiko.iwamoto](https://get-help.theconstruct.ai/u/reiko.iwamoto)\
**Post date:** [February 29, 2024, 5:21am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/5 "2024-02-29T05:21:34Z")

</div>

Hi @girishkumar.kannan  
I had checked CMakeLists and package.xml many times.  
I included `nav_msgs` since it include geometry\_msgs as well,  
but it didnt work, so i removed from this interface for now.

Below is packages.xml.

```auto
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>rosject_msg</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>
  <maintainer email="user@todo.todo">user</maintainer>
  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake</buildtool_depend>

  <depend>rclcpp</depend>
  <depend>std_msgs</depend>
  <depend>action_msgs</depend>
  <depend>geometry_msgs</depend>
  <depend>rosidl_default_generators</depend>

  <exec_depend>rosidl_default_runtime</exec_depend>
  <member_of_group>rosidl_interface_packages</member_of_group>

  <test_depend>ament_lint_auto</test_depend>
  <test_depend>ament_lint_common</test_depend>

  <export>
    <build_type>ament_cmake</build_type>
  </export>
</package>

```

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [February 29, 2024, 5:23am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/6 "2024-02-29T05:23:06Z")

</div>

Hi @reiko.iwamoto ,

I just saw your `CMakeLists.txt` file for `rosject_msg` package (since you posted it late).  
If you are using ROS2 Galactic or Humble, you should also include the following line in the `rosidl_generate_interfaces()` block in your `CMakeLists.txt` file:

```bash
rosidl_generate_interfaces(${PROJECT_NAME}
  "srv/FindWall.srv"
  "action/OdomRecord.action"
  DEPENDENCIES std_msgs geometry_msgs # <--- add this line
)

```

Try this and let me know.

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![reiko.iwamoto](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/reiko.iwamoto/32/7933_2.png) [@reiko.iwamoto](https://get-help.theconstruct.ai/u/reiko.iwamoto)\
**Post date:** [February 29, 2024, 5:33am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/7 "2024-02-29T05:33:52Z")

</div>

Hi @girishkumar.kannan,  
Thank you for the advice.  
I got another error now…

```auto
user:~/ros2_ws$ colcon build --packages-select rosject_msg
Starting >>> rosject_msg
--- stderr: rosject_msg
CMake Error at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:162 (message):
  rosidl_generate_interfaces() the passed dependency 'geometry_msg' has not
  been found before using find_package()
Call Stack (most recent call first):
  CMakeLists.txt:26 (rosidl_generate_interfaces)

gmake: *** [Makefile:963: cmake_check_build_system] Error 1
---
Failed <<< rosject_msg [1.49s, exited with code 2]

Summary: 0 packages finished [1.71s]
  1 package failed: rosject_msg
  1 package had stderr output: rosject_msg
user:~/ros2_ws$

```

Thought the order of installing package was issue.  
But it didnt work as expected.

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [February 29, 2024, 5:35am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/8 "2024-02-29T05:35:08Z")

</div>

Hi @reiko.iwamoto ,

You have typed `geometry_msg` instead of `geometry_msgs`.

Please read the error and try to understand what it says before posting it as an error here.

Fix that package name error and you should be fine.

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![reiko.iwamoto](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/reiko.iwamoto/32/7933_2.png) [@reiko.iwamoto](https://get-help.theconstruct.ai/u/reiko.iwamoto)\
**Post date:** [February 29, 2024, 5:37am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/9 "2024-02-29T05:37:51Z")

</div>

@girishkumar.kannan  
Thank you so much!! It compiled now!

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [February 29, 2024, 5:38am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/10 "2024-02-29T05:38:45Z")

</div>

Hi @reiko.iwamoto ,

Glad to know that your problem is resolved.

Please mark the solution and this thread can be closed.

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [March 5, 2024, 5:39am UTC](https://get-help.theconstruct.ai/t/no-such-file-or-directory-geometry-msgs-point32/29127/11 "2024-03-05T05:39:15Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
