编译出错

工程师您好,自己新建的包,update,upgrade之前编译都是好的,之后再编译时都出错,请看下是什么原因。

1当前环境:

apt update

apt upgrade

tros 1.1.6

2编译时的打印信息:

root@ubuntu:~/dev_ws# colcon build --packages-select cpp_dnn_demo

Starting >>> cpp_dnn_demo

-– stderr: cpp_dnn_demo

CMake Error at /opt/tros/share/fastrtps/cmake/fastrtps-targets.cmake:79 (message):

The imported target “fastrtps” references the file

“/opt/tros/lib/libfastrtps.so.2.1.3”

but this file does not exist. Possible reasons include:

* The file was deleted, renamed, or moved to another location.

* An install or uninstall procedure did not complete successfully.

* The installation package was faulty and contained

“/opt/tros/share/fastrtps/cmake/fastrtps-targets.cmake”

but not all the files it references.

Call Stack (most recent call first):

/opt/tros/share/fastrtps/cmake/fastrtps-config.cmake:54 (include)

/opt/tros/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c-extras.cmake:6 (find_package)

/opt/tros/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_cConfig.cmake:41 (include)

/opt/tros/share/rosidl_typesupport_c/cmake/rosidl_typesupport_c-extras.cmake:13 (find_package)

/opt/tros/share/rosidl_typesupport_c/cmake/rosidl_typesupport_cConfig.cmake:41 (include)

/opt/tros/share/rosidl_default_runtime/cmake/rosidl_default_runtime-extras.cmake:12 (find_package)

/opt/tros/share/rosidl_default_runtime/cmake/rosidl_default_runtimeConfig.cmake:41 (include)

/opt/tros/share/builtin_interfaces/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)

/opt/tros/share/builtin_interfaces/cmake/builtin_interfacesConfig.cmake:41 (include)

/opt/tros/share/rcl_interfaces/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)

/opt/tros/share/rcl_interfaces/cmake/rcl_interfacesConfig.cmake:41 (include)

/opt/tros/share/rcl/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)

/opt/tros/share/rcl/cmake/rclConfig.cmake:41 (include)

/opt/tros/share/libstatistics_collector/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)

/opt/tros/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)

/opt/tros/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)

/opt/tros/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)

CMakeLists.txt:20 (find_package)

-–

Failed <<< cpp_dnn_demo [5.13s, exited with code 1]

Summary: 0 packages finished [6.66s]

1 package failed: cpp_dnn_demo

1 package had stderr output: cpp_dnn_demo

root@ubuntu:~/dev_ws#

3 CMakeLists.txt:20 (find_package) :内容如下

# find dependencies-
19 find_package(ament_cmake REQUIRED)-
20 find_package(rclcpp REQUIRED)

4问题:

/opt/tros/lib/libfastrtps.so.2.1.3 在实际路径中找不到

您好,清除编译缓存试一下,在命令后面加上–cmake-clean-cache

升级过程中出现空间不足,tros可能没有升级成功。要手动删除tros文件夹,重新安装tros后可以正常编译。