Project makefile defines
are set in .vscode/c_cpp_properties.json
.
"configurations": [
{
...
"defines":[
"MYSYMBOL",
"MYVALUE=1"
]
}
], ...
Here are some methods to open c_cpp_properties.json
:
-
Find a green squiggle on something like an include statement that Intellisense can’t resolve. Hover around and click the lightbulb that appears (which is tiny and a bit of a game to click). It will open the project config file in the editor.
-
Same as above, but put cursor on the green squiggle line and press
Ctrl
+.
. -
Use the command pallet:
ctrl
+shift
+P
, then selectC/C++: Edit configurations (JSON)
. -
If the file already exists in your .vscode folder, open it with
File
->Open
.
Although vscode will reprocess the settings after c_cpp_properties.json
is modified, I found a restart is sometimes required when changing values.
There is basic and incomplete information here: https://code.visualstudio.com/docs/languages/cpp
This is a good link about the c_cpp_properties.json
file itself: https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference