Don't have c_cpp_properties.json file in vscode

Viewed 18709

I started learning cpp in vscode a while ago. I am not getting back into it but I have no idea how to compile/run programs and every tutorial that I'm watching is saying that I have to copy and paste the path from my MinGW folder to the path in c_cpp_properties.json but within my .vscode folder I don't have that file. Instead I have three other files.

enter image description here

How do I add the c_cpp_properties.json file?

3 Answers

You can view the C/C++ configuration UI by running the command C/C++: Edit Configurations (UI) from the Command Palette (Ctrl+Shift+P).

From here.

This will add c_cpp_properties file.

Typing (Ctrl+Shift+P) is not sufficient. The list of options that appears does not include "C/C++ Edit Configurations ( UI )"

It is necessary to type (Ctrl+Shift+P) then start typing "edit", when the option should appear and can then be selected.

Note that once this has been done once, the option appears immediately on later (Ctrl+Shift+P). I suppose that this is why in so many answers and even the official vscode docs it is not mentioned that you must type edit the first time it is used.

Only for Ubuntu. I had this trouble in Ubuntu. I changed keys by few tweaks (GNOME TWEAK TOOL) to change language layout ru <-> en using CTRL + Shift and it broke commands in Visual Studio code.

For example, I couldn't invoke by CTRL + Shift + P for create file c_cpp_properties.json. When I changed Ctrl + Shift to other ALT + Shift - keyboard shortcut Ctrl + Shift + P started to work properly and I could generate c_cpp_properties.json. Try to check your keyboard shortcut. CTRL + Shift should be reserved for Visual Studio code.

Related