19

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?

1
  • you don't need c_cpp_properties.json to compile C++, it is used for the intellisense Commented May 27, 2020 at 11:21

3 Answers 3

31

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Note that you have to install the Microsoft C++ extension first, otherwise the command wont appear.
7

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.

1 Comment

As a complement, I had tried to add c_cpp_properties.json by edit settings->extensions->c/c++, but it wouldn't add a file for me if it don't exist and edit don't take effect. This answer help me a lot.
0

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.

1 Comment

Welcome to SO! Please use text formatting tools for posting the question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.