Closed LoveDaisy closed 4 months ago
@LoveDaisy C/C++: Log Diagnostics is only in the command palette when a C/C++ file is active.
Our extension is the C/C++ extension and not the clangd extension -- which do you intend to use? The C_Cpp settings are for the C/C++ extension. You should set the compilerPath setting and avoid setting system includes explicitly, since in your case you only provided 1 of them. You could also set the configurationProvider or compileCommands properties. Maybe look at https://code.visualstudio.com/docs/cpp/cmake-linux .
Sorry for my confusion. I'm using both C/C++ extension and clangd extension. How to tell whether this problem is caused by clangd or c/c++?
I've tried: 1. to provide only compiler path; 2. to provide both compiler path and system include paths. But both have nothing to do with the problem.
I also tried to set compileCommands to the "compile_commands.json" file, but also nothing helps.
And additional information. I tried exactly the same settings on another machine (ssh to another host, whose OS is also ubuntu), the same extensions and the same configurations, and everything works smoothly.
@LoveDaisy You could disable one. Or instead of disabling the C/C++ extension you can set C_Cpp.intelliSenseEngine to "disabled".
If you have the CMake Tools extension installed then our extension maybe trying to use that to configure. You can use the C/C++: Log Diagnostics command after opening a C/C++ file to see how the file is getting configured for IntelliSense.
Thanks for you advices @sean-mcmanus !
I think there may be something wrong at the specific machine. Now the instance is closed and there's no problem with new instances. Your advices are valuable in case I come into the same problem next time. Thanks for your time!
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
<algorithm>
,<string>
), even if I manually specifyincludePath
andsystemIncludePath
.Steps to reproduce:
./script/build.sh
and it works well.build
folder and enter the "CMake" panel. Click "Delete cache and reconfigure" icon (or cmd+shift+p and choose "CMake: Delete cache and reconfigure") -- it configure successfully. Then click "Build" icon (or cmd+shift+p and choose "CMake: Build target") -- it build successfully.#include <...>
line. The error is only on the std headers, while the project headers are all OK.compile_commands.json
. It is generated successfully and I've copied it tobuild/compile_commands.json
where it should be.Expected behavior: C++ std header files can be find correctly.
Configuration and Logs