vscode自动补全函数跳转

vscode自动补全函数跳转vscode 目录下 c cpp properties json 文件 configuratio 里 includePath 设置 configuratio name Linux includePath workspaceFol defines com

.vscode目录下c_cpp_properties.json文件configurations里includePath,compileCommands设置

{ "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "clang-x64", "compileCommands": "${workspaceFolder}/build_isolated/cartographer/install/compile_commands.json" } ], "version": 4 } 

“${workspaceFolder}/”

包含当前工作空间下所有文件

或者有自定义的一些头文件在编译后生成,找到工作空间下devel/include。

在c_cpp_properties.json的includePath里添加如

"/home/c(用户名)/test_ws(工作空间名)/devel/"

PS:catkin编译时加上命令参数-DCMAKE_EXPORT_COMPILE_COMMANDS=Yes导出json文件,

在vscode中添加配置环境。

例:

#生成makefile同时导出json文件 #catkin_make_isolated --install --use-ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=Yes 

或者在根cmakelist中设置

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

修改

"compileCommands": "${workspaceFolder}/build_isolated/cartographer/install/compile_commands.json"

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/225481.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 上午9:14
下一篇 2026年3月17日 上午9:14


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号