I don't get why my Intellisense keeps giving me error and other hints #11901
Unanswered
Simone Vollaro (slim71)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I don't know whether this is a bug or rather something I'm doing/understanding wrong, so here goes.
I have a ROS2 project I'm developing mainly in C++, using VSCode and the C/C++ extension. Here's a link to the complete project, if needed, but I'll post the important details here.
I have the following
c_cpp_properties.jsonfile{ "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/src/pelican/**", "${workspaceFolder}/src/datapad/**", "${workspaceFolder}/src/Micro-XRCE-DDS-Agent/include/uxr/agent/**", "/opt/ros/humble/include/**", "${workspaceFolder}/install/comms/include/**", "${workspaceFolder}/install/px4_msgs/include/px4_msgs/**", "${workspaceFolder}/install/px4_ros_com/include/px4_ros_com/**", "/home/slim71/Documents/git/pugixml", "/usr/include/**", "/usr/include/", "/usr/local/include/**", "/usr/local/include/" ], "defines": [], "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "${default}", "compileCommands": "${workspaceFolder}/build/compile_commands.json" } ], "version": 4, "enableConfigurationSquiggles": true }and this
settings.jsonfileAs you can see, I'm using a


compile_commands.jsonfile (generated by colcon) though I'm still new to this, and I've also set theincludePathvalue with all folders in which I have possible used includes.Right now most of the code seems to be recognized, but I still have some red squiggles saying "cannot open source file math.h"
and the functions definitions seem not to be found.
I've tried adding the
compilerPathsetting, linking to/usr/bin/gcc, but strangely enough that seems to make things worse: the scan job seems to be spinning forever and it won't complete. I guess there's too much to scan?EDIT: after a long time, it finished scanning but things are not looking good: now the issue for
math.his fine, it seems, but it says functions definitions are not found. I have found this issue which might be related to this though, so I think usingcompilerPathis a no-go for now...So now I'm trying to understand how I can get rid of the error for math.h (which of course is present in
/usr/include/) to get everything nice and clear.Any suggestions? 😄
EDIT2: some details:
VSCode version: 1.85.2
C/C++ extension version: 1.18.5
All reactions