[TIL_Carrotww] 123 - 23/07/14

์œ ํ˜•์„ยท2023๋…„ 7์›” 15์ผ
0

TIL

๋ชฉ๋ก ๋ณด๊ธฐ
138/138
post-thumbnail

๐Ÿ“Carrotww์˜ ์ฝ”๋”ฉ ๊ธฐ๋ก์žฅ

๐Ÿงฒ vscode cpp setting

๐Ÿ” vscode์—์„œ cpp๊ณผ python, java - sprint boot ๊นŒ์ง€ ๋ชจ๋‘ ํ•˜๊ธฐ๋•Œ๋ฌธ์— ์„ค์ •ํžˆ ํ•œ๋ฒˆ ๊ผฌ์ด๋ฉด ์ข€ ๊ณจ์ด ์•„ํ”„๋‹ค.
๋‚˜๋Š”

bin bash

๋กœ ์‰˜ ์ž‘์—…์„ ํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— c++ ์„ค์ •์€ ์กฐ๊ธˆ ๋‹ค๋ฅผ ์ˆ˜๊ฐ€ ์žˆ์–ด ์—ฌ๊ธฐ์— ๋‚ด ์„ค์ •๋“ค์„ ๊ธฐ๋กํ•ด ๋†“๋Š”๋‹ค.

๋‚˜๋Š” Mingw๋ฅผ C:/MinGW/bin/gcc ์™€ ๊ฐ™์€ ๊ฒฝ๋กœ์— ๋ฐ›์•„์„œ ์„ค์ •ํ•ด ๋†“์•˜๋‹ค.

c_cpp_properties.json ํŒŒ์ผ

{
  "configurations": [
    {
      "name": "windows-gcc-x86",
      "includePath": ["${workspaceFolder}/**"],
      "compilerPath": "C://MinGW//bin//gcc.exe",
      "cStandard": "${default}",
      "cppStandard": "${default}",
      "intelliSenseMode": "windows-gcc-x86",
      "compilerArgs": [""],
      "configurationProvider": "ms-vscode.cmake-tools"
    }
  ],
  "version": 4
}

launch.json ํŒŒ์ผ

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "java",
      "name": "BoardApplication",
      "request": "launch",
      "mainClass": "BoardApplication",
      "projectName": "hyeongcode_7fef0519"
    },
    {
      "type": "java",
      "name": "DemoApplication",
      "request": "launch",
      "mainClass": "com.example.demo.DemoApplication",
      "projectName": "demo",
      "vmArgs": " -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=51967 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dspring.jmx.enabled=true -Djava.rmi.server.hostname=localhost -Dspring.application.admin.enabled=true -Dspring.boot.project.name=demo"
    },
    {
      "name": "g++.exe build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ]
    }
  ]
}

settings.json ์˜ code-runner.executorMap ๋ถ€๋ถ„

  "code-runner.executorMap": {
    "python": "set PYTHONIOENCODING=utf8 && python -u",
    "javascript": "node",
    "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
    "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "cpp": "chcp.com 65001 && cd $dirWithoutTrailingSlash && g++ $fileName -g -o $fileNameWithoutExt && ./$fileNameWithoutExt.exe", 

tasks.json ํŒŒ์ผ

{
    "version": "2.0.0",
    "runner": "terminal",
    "type": "shell",
    "echoCommand": true,
    "presentation": {
      "reveal": "always"
    },
    "tasks": [
      {
        "label": "save and compile for C++",
        "command": "g++",
        "args": [
          "${file}",
          "-o",
          "${fileDirname}/${fileBasenameNoExtension}"
        ],
        "group": {
          "kind": "build",
          "isDefault": true
        },
        "problemMatcher": "$gcc"
      },
      {
        "label": "save and compile for C",
        "command": "gcc",
        "args": [
          "${file}",
          "-o",
          "${fileDirname}/${fileBasenameNoExtension}"
        ],
        "group": "build",
        "problemMatcher": "$gcc"
      },
      {
        "label": "execute",
        "command": "bash",
        "group": "test",
        "args": [
          "-c",
          "\"${fileDirname}/${fileBasenameNoExtension}\""
        ]
      },
      {
        "type": "cppbuild",
        "label": "C/C++: gcc.exe ํ™œ์„ฑ ํŒŒ์ผ ๋นŒ๋“œ",
        "command": "C:/MinGW/bin/gcc.exe",
        "args": [
          "-g",
          "${file}",
          "-o",
          "${fileDirname}/${fileBasenameNoExtension}.exe"
        ],
        "options": {
          "cwd": "${fileDirname}"
        },
        "problemMatcher": [
          "$gcc"
        ],
        "group": "build",
        "detail": "๋””๋ฒ„๊ฑฐ์—์„œ ์ƒ์„ฑ๋œ ์ž‘์—…์ž…๋‹ˆ๋‹ค."
      },
      {
        "type": "cppbuild",
        "label": "C/C++: g++.exe ํ™œ์„ฑ ํŒŒ์ผ ๋นŒ๋“œ",
        "command": "C:/MinGW/bin/g++.exe",
        "args": [
          "-g",
          "${file}",
          "-o",
          "${fileDirname}/${fileBasenameNoExtension}.exe"
        ],
        "options": {
          "cwd": "${fileDirname}"
        },
        "problemMatcher": [
          "$gcc"
        ],
        "group": "build",
        "detail": "๋””๋ฒ„๊ฑฐ์—์„œ ์ƒ์„ฑ๋œ ์ž‘์—…์ž…๋‹ˆ๋‹ค."
      },
      {
        "type": "cppbuild",
        "label": "C/C++: gcc.exe ํ™œ์„ฑ ํŒŒ์ผ ๋นŒ๋“œ",
        "command": "C:/MinGW/bin/gcc.exe",
        "args": [
          "-g",
          "${file}",
          "-o",
          "${fileDirname}/${fileBasenameNoExtension}.exe"
        ],
        "options": {
          "cwd": "${fileDirname}"
        },
        "problemMatcher": [
          "$gcc"
        ],
        "group": "build",
        "detail": "์ปดํŒŒ์ผ๋Ÿฌ: C:/MinGW/bin/gcc.exe"
      }
    ]
  }

0๊ฐœ์˜ ๋Œ“๊ธ€