Profile
김준땡

2019.10.28

vscode c, c++ 컴파일 세팅

조회 수 298 추천 수 0

launch.json

 

{

    // IntelliSense를 사용하여 가능한 특성에 대해 알아보세요.

    // 기존 특성에 대한 설명을 보려면 가리킵니다.

    // 자세한 내용을 보려면 https://go.microsoft.com/fwlink/?linkid=830387을(를) 방문하세요.

    "version": "0.2.0",

    "configurations": [

        {

            "name": "g++.exe build and debug active file",

            "type": "cppdbg",

            "request": "launch",

            "program": "${fileDirname}/${fileBasenameNoExtension}",

            "args": [],

            "stopAtEntry": false,

            "cwd": "${workspaceFolder}",

            "environment": [],

            "externalConsole": false,

            "MIMode": "gdb",

            "miDebuggerPath": "/usr/bin/gdb",

            "setupCommands": [

                {

                    "description": "Enable pretty-printing for gdb",

                    "text": "-enable-pretty-printing",

                    "ignoreFailures": true

                }

            ]

        }

    ]

}

tasks.json

 

{

    "version": "2.0.0",

    "runner": "terminal",

    "type": "shell",

    "echoCommand": true,

    "presentation" : { "reveal": "always" },

    "tasks": [

          //C++ 컴파일

          {

            "label": "save and compile for C++",

            "command": "g++",

            "args": [

                "${file}",

                "-o",

                "${fileDirname}/${fileBasenameNoExtension}"

            ],

            "group": "build",

 

            //컴파일시 에러를 편집기에 반영

            //참고:   https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher

 

            "problemMatcher": {

                "fileLocation": [

                    "relative",

                    "${workspaceRoot}"

                ],

                "pattern": {

                    // The regular expression. 

                   //Example to match: helloWorld.c:5:3: warning: implicit declaration of function 'prinft'

                    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",

                    "file": 1,

                    "line": 2,

                    "column": 3,

                    "severity": 4,

                    "message": 5

                }

            }

        },

        //C 컴파일

        {

            "label": "save and compile for C",

            "command": "gcc",

            "args": [

                "${file}",

                "-o",

                "${fileDirname}/${fileBasenameNoExtension}"

            ],

            "group": "build",

 

            //컴파일시 에러를 편집기에 반영

            //참고:   https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher

 

            "problemMatcher": {

                "fileLocation": [

                    "relative",

                    "${workspaceRoot}"

                ],

                "pattern": {

                    // The regular expression. 

                   //Example to match: helloWorld.c:5:3: warning: implicit declaration of function 'prinft'

                    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",

                    "file": 1,

                    "line": 2,

                    "column": 3,

                    "severity": 4,

                    "message": 5

                }

            }

        },

        // 바이너리 실행(Ubuntu)

        {

            "label": "execute",

            "command": "cd ${fileDirname} && ./${fileBasenameNoExtension}",

            "group": "test"

       }

    ]

}

Profile
30
Lv

0개의 댓글

Profile
번호 제목 글쓴이 날짜 조회 수
12 사이트 주인장은 보시오 2 profile 머봉이 2022.04.13 326
11 돈 모아서 차 한대 뽑았습니다 ^^ 2 profile LINEARJUN 2022.03.14 299
10 이거 보셈 5 익명 2022.03.14 294
9 The definition of Love. 1 Anonymous 2020.11.13 1492
8 유니티 최적화 팁 - 퍼옴 6 profile LINEARJUN 2019.11.10 582
vscode c, c++ 컴파일 세팅 김준땡 2019.10.28 298
6 시놀로지 GCC 설치 1 profile LINEARJUN 2019.10.28 556
5 BFS BRING ME HERE!! 1 profile 머봉이 2019.10.02 325
4 등업부탁드려요~~ profile 머봉이 2019.10.02 294
3 Visual Studio Code에서 Remote-SSH 문제 1 profile LINEARJUN 2019.10.01 751
2 christmas page 열어줘요 어디에 있나요 1 fkaus567@gmail.com 2019.09.11 332
1 TwoVoice Prototye Demo profile LINEARJUN 2019.06.04 304