Ubuntu下利用VScode编写ROS的CPP文件时,#include “rclcpp/rclcpp.hpp“报错,找不到头文件 |
您所在的位置:网站首页 › vscode如何添加lib › Ubuntu下利用VScode编写ROS的CPP文件时,#include “rclcpp/rclcpp.hpp“报错,找不到头文件 |
1 打开 VScode的配置文件c_pp_properties
将鼠标放在报错的#include “-------------------” 处,出现灯泡则点击灯泡图标,或者出现快速修复,则点击快速修复 (1)出现灯泡提示 然后点击Edit"includePath"setting 添加并配置c_cpp_properties.json,在"includePath"中加入rclcpp/rclcpp.hpp的路径(或者你所报错的路径),注意,多个路径间用逗号分开。 { "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", "/opt/ros/foxy/include" //解决cpp文件中找不到"rclcpp/rclcpp.hpp' ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "gnu17", "cppStandard": "gnu++14", "intelliSenseMode": "linux-gcc-x64" } ], "version": 4 } 配置结果配置好的c_cpp_properties.json将自动保存在 .vscode 文件夹中。 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |