edo1z blog

プログラミングなどに関するブログです

vscodeで #include <bits/stdc++.h> を使う

使えてたのに突然使えなくなりました。悲しいです。

  • ctrl + shift + p でコマンドパレットを開きます。
  • c++ edit json などと入力して、「c/c++ Edit Configurations (JSON)」を実行します。
  • すると、.vscode内に、c_cpp_properties.jsonが作成されます。
  • compilerPathを環境に合わせて修正します。
  • intelliSenseModeも環境に合わせて修正します。

自分の環境に合わせて修正したc_cpp_properties.json

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.17763.0",
            "compilerPath": "E:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe",
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

上記の設定だけで、使えるようになりました。