A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Hi @海斯森 习科 ,
The errors you're seeing (command 'cmake.fullCleanConfigureAndBuild' not found and command 'extension.CompileRun' not found) indicate the extensions aren't being activated, rather than a problem with your compiler - since g++ --version works, your toolchain is fine.
Could you check the following?
- Run Extensions: Show Enabled Extensions from the Command Palette and confirm CMake Tools and Code Runner are enabled, not just installed.
- Check whether the window is in Restricted Mode (bottom status bar). If so, trust the workspace - untrusted folders block these extensions from activating.
- Make sure you opened the project folder containing CMakeLists.txt via File > Open Folder, not just a single source file.
CMakeTools only activates on a folder with aCMakeproject. - Open Help > Toggle Developer Tools > Console and Output > Extension Host, and share any errors there - that usually points to a crashed extension host.
You can also start VS Code with code --disable-extensions, then re-enable extensions one at a time, or create a fresh profile (Profiles: Create Profile) to rule out a corrupted profile from the recent CMake/VS reinstalls.
Please share the Extension Host log and we'll narrow it down from there.
If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.