9

https://code.visualstudio.com/docs/cpp/config-msvc

I'm trying to use VS Code to compile and run c++ using these instructions. While completing this step

Start typing "C/C++" and then choose Edit Configurations from the list of suggestions. VS Code creates a file called c_cpp_properties.json in the .vscode subfolder and populates it with some default settings.

I can't get the c_cpp_properties.json file to open and I get the error:

Failed to create "c:\Windows\System32\projects\helloworld\.vscode": EPERM: operation not permitted, mkdir 'c:\Windows\System32\projects\helloworld\.vscode'
Ryan Marr
  • 103

3 Answers3

11

Generally, c_cpp_properties.json should be found by

  1. Pressing Control+Shift+P
  2. Searching for c/c++ edit configuration.
montonero
  • 608
Amin
  • 111
1

You probably have no permissions. Your options include running VSCode as admin or changing folder permissions. But why do you store projects in system32 in the first place? The best solution would be to move it to some other place, where user has write access without admin rights, like Documents.

p0358
  • 36
1

Your problem is definitely file access permission issues. Opening VS Code as system admin would solve your problems.

While for some other issues (i.e., pressing Ctrl + Shift + P, and searching c/c++:edit configuration still does not show the matched prompt), reinstalling VS Code is very likely to solve it.