My VS Code cannot compile properly, the compilation options are missing.

海斯森 习科 0 Reputation points
2026-09-18T03:10:20.5466667+00:00

For some reason, all the compilation options in my VS Code are gone, and I can't invoke the compiler either. I've tried reinstalling VS Code, but it still has no effect. In the terminal, g++ --version can normally detect the compiler, and the system environment variables are configured properly. I also installed the C++ extension and CMake normally, but when I run some reset commands, it still says files are missing (common'cmake.fullcleanconfigureandbuild'not found). I also tried using Code Runner and C/C++ Compile Run to compile (common'extension.CompileRun'not found), but both failed. I've searched the internet as much as possible for solutions, but I can hardly find any effective solution. I'm now extremely anxious and frustrated after all this. By the way, my computer recently tried to update CMake and changed some environment variables, but I changed them back afterward, and I also recently reinstalled VS 2026 and 2022. I don't know if it's related to that...

Y0@$0UN5NWY(SQJ_OO4%D

User's image

%QMOCZ[D_4$26B7GNQV}R

![X)_RM1B2`]2LZQP1[L]A0US](/api/attachments/306ba4e7-02c2-4ba9-a8fd-c924d45931c0?platform=QnA)

_2(ZT0W53~6LB}RHK4I0~NX

User's image

User's image

User's image

User's image

Developer technologies | C++
Developer technologies | C++

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.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Jay Pham (WICLOUD CORPORATION) 4,595 Reputation points Microsoft External Staff Moderator
    2026-09-18T07:08:05.5766667+00:00

    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?

    1. Run Extensions: Show Enabled Extensions from the Command Palette and confirm CMake Tools and Code Runner are enabled, not just installed.
    2. Check whether the window is in Restricted Mode (bottom status bar). If so, trust the workspace - untrusted folders block these extensions from activating.
    3. Make sure you opened the project folder containing CMakeLists.txt via File > Open Folder, not just a single source file. CMake Tools only activates on a folder with a CMake project.
    4. 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. 

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.