メモ:VSCode の C/C++ 拡張機能に define を追加

上の枠に

> Edit Configuration

まで入れて、GUI なら「定義」という窓があるので、そこに例えば

LINUX

といれる。

JSON なら defines のかぎかっこの中に例えば

"LINUX"

と入れる。

リモートだとこんな感じで保存される。

$ cat ~/.vscode/c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": ["LINUX"],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4

Add a comment

Fields followed by * are mandatory

HTML code is displayed as text and web addresses are automatically converted.

Add ping

Trackback URL : https://www.pseudomoon.jp/dotclear/index.php?trackback/231

Page top