Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)
I'm attempt to build a package with a custom action, but it fails with an error Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)
. Please find full colon
output below.
Google points me out to this fix and with
export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH:$CMAKE_PREFIX_PATH
it works. Is it an issue I have to report to some repository or it's something missed in my CMakeLists.txt
or package.xml
files?
$colcon build --packages-select my_package
Starting >>> my_package
--- stderr: my_package
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/opt/ros/dashing/share/fastrtps_cmake_module/cmake/Modules/FindFastRTPS.cmake:95 (find_package_handle_standard_args)
/opt/ros/dashing/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c-extras.cmake:7 (find_package)
/opt/ros/dashing/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_cConfig.cmake:38 (include)
/opt/ros/dashing/share/rosidl_default_generators/cmake/rosidl_default_generators-extras.cmake:21 (find_package)
/opt/ros/dashing/share/rosidl_default_generators/cmake/rosidl_default_generatorsConfig.cmake:38 (include)
CMakeLists.txt:6 (find_package)
---
Failed <<< my_package [ Exited with code 1 ]
Summary: 0 packages finished [0.82s]
1 package failed: my_package
1 package had stderr output: my_package
that would be difficult to determine, seeing as you don't show us either of those files.
But I don't believe this is a problem in your package, but in your environment.
You'll probably have to describe how you installed ROS, how you normally activate/setup your workspace and whether you get this error with all packages that try to build messages or just this particular one.
Hi there, i encounted the same problem today, I saw your solution and solved my problem. Thanks.
I dont think so.
I have installed ROS2 binary and ROS2 source code in my PC.
Before i run the colcon build steps, i source the ROS2 binary path:
source /opt/ros/dashing/setup.bash
, then i check the AMENT_PREFIX_PATH and CMAKE_PREFIX_PATH variables.TheAMENT_PREFIX_PATH=/opt/ros/dashing
, while the CMAKE_PREFIX_PATH has empty value, so the colcon build was failed.But if i source the ROS2 source code path
source ~/ros2_ws/install/local_setup.bash
, then the variable AMENT_PREFIX_PATH and CMAKE_PREFIX_PATH have the same value. so the problem may result from that you installed the ROS2 binary version.Back to the point. what cause the difference between the above phenomenon. i still have no idea....