DrawingProcess
๋“œํ”„ DrawingProcess
DrawingProcess
์ „์ฒด ๋ฐฉ๋ฌธ์ž
์˜ค๋Š˜
์–ด์ œ
ยซ   2025/05   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
  • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (964)
    • Profile & Branding (22)
      • Career (15)
    • IT Trends (254)
      • Conference, Faire (Experien.. (31)
      • News (187)
      • Youtube (19)
      • TED (8)
      • Web Page (2)
      • IT: Etc... (6)
    • Contents (97)
      • Book (66)
      • Lecture (31)
    • Project Process (94)
      • Ideation (0)
      • Study Report (34)
      • Challenge & Award (22)
      • 1Day1Process (5)
      • Making (5)
      • KRC-FTC (Team TC(5031, 5048.. (10)
      • GCP (GlobalCitizenProject) (15)
    • Study: ComputerScience(CS) (72)
      • CS: Basic (9)
      • CS: Database(SQL) (5)
      • CS: Network (14)
      • CS: OperatingSystem (3)
      • CS: Linux (39)
      • CS: Etc... (2)
    • Study: Software(SW) (95)
      • SW: Language (29)
      • SW: Algorithms (1)
      • SW: DataStructure & DesignP.. (1)
      • SW: Opensource (15)
      • SW: Error Bug Fix (43)
      • SW: Etc... (6)
    • Study: Artificial Intellige.. (149)
      • AI: Research (1)
      • AI: 2D Vision(Det, Seg, Tra.. (35)
      • AI: 3D Vision (70)
      • AI: MultiModal (3)
      • AI: SLAM (0)
      • AI: Light Weight(LW) (3)
      • AI: Data Pipeline (7)
      • AI: Machine Learning(ML) (1)
    • Study: Robotics(Robot) (33)
      • Robot: ROS(Robot Operating .. (9)
      • Robot: Positioning (8)
      • Robot: Planning & Control (7)
    • Study: DeveloperTools(DevTo.. (83)
      • DevTool: Git (12)
      • DevTool: CMake (13)
      • DevTool: NoSQL(Elastic, Mon.. (25)
      • DevTool: Container (17)
      • DevTool: IDE (11)
      • DevTool: CloudComputing (4)
    • ์ธ์ƒ์„ ์‚ด๋ฉด์„œ (64)
      • ๋‚˜์˜ ์ทจ๋ฏธ๋“ค (7)
      • ๋‚˜์˜ ์ƒ๊ฐ๋“ค (42)
      • ์—ฌํ–‰์„ ๋– ๋‚˜์ž~ (10)
      • ๋ถ„๊ธฐ๋ณ„ ํšŒ๊ณ  (5)

๊ฐœ๋ฐœ์ž ๋ช…์–ธ

โ€œ ๋งค์ฃผ ๋ชฉ์š”์ผ๋งˆ๋‹ค ๋‹น์‹ ์ด ํ•ญ์ƒ ํ•˜๋˜๋Œ€๋กœ ์‹ ๋ฐœ๋ˆ์„ ๋ฌถ์œผ๋ฉด ์‹ ๋ฐœ์ด ํญ๋ฐœํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ด๋ณด๋ผ.
์ปดํ“จํ„ฐ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ์ด๋Ÿฐ ์ผ์ด ํ•ญ์ƒ ์ผ์–ด๋‚˜๋Š”๋ฐ๋„ ์•„๋ฌด๋„ ๋ถˆํ‰ํ•  ์ƒ๊ฐ์„ ์•ˆ ํ•œ๋‹ค. โ€

- Jef Raskin

๋งฅ์˜ ์•„๋ฒ„์ง€ - ์• ํ”Œ์ปดํ“จํ„ฐ์˜ ๋งคํ‚จํ† ์‹œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ฃผ๋„

์ธ๊ธฐ ๊ธ€

์ตœ๊ทผ ๊ธ€

์ตœ๊ทผ ๋Œ“๊ธ€

ํ‹ฐ์Šคํ† ๋ฆฌ

hELLO ยท Designed By ์ •์ƒ์šฐ.
DrawingProcess

๋“œํ”„ DrawingProcess

[IDE] VSCode C++ ๋””๋ฒ„๊น… ํ™˜๊ฒฝ ์„ธํŒ…(task.json, launch.json): Clang on MacOS
Study: DeveloperTools(DevTool)/DevTool: IDE

[IDE] VSCode C++ ๋””๋ฒ„๊น… ํ™˜๊ฒฝ ์„ธํŒ…(task.json, launch.json): Clang on MacOS

2022. 12. 15. 10:59
๋ฐ˜์‘ํ˜•
๐Ÿ’ก ๋ณธ ๋ฌธ์„œ๋Š” 'M1 ๋งฅ๋ถ์—์„œ VSCODE C++ ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ค์ •'์— ๋Œ€ํ•ด ์ •๋ฆฌํ•ด๋†“์€ ๊ธ€์ž…๋‹ˆ๋‹ค.
VSCode๋กœ ๊ฐœ๋ฐœํ™˜๊ฒฝ์„ ์„ธํŒ…ํ•˜๋‹ค๋ณด๋ฉด tasks.json, launch.json ๋“ฑ ์–ด๋–ป๊ฒŒ ํ• ์ง€ ํ—ท๊ฐˆ๋ฆด๋•Œ๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์ผ๋ถ€ OS dependencyํ•œ ์„ค์ •๋„ ๋งŽ๊ธฐ์— ์ผ๋‹จ ์ œ ๊ฐœ๋ฐœํ™˜๊ฒฝ์ธ M1 Mac์—์„œ ๋””๋ฒ„๊น…ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์ •๋ฆฌํ•ด ๋†“์•˜์œผ๋‹ˆ ์ฐธ๊ณ ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

1. ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ธํŒ…

1.1 VSCODE ๋‹ค์šด๋กœ๋“œ

mac OS ํ™˜๊ฒฝ ๋ฐ M1 ์ด๋ผ๋ฉด Apple Silicon ๋ฒ„์ „ ๋‹ค์šด๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.

  • ์ง์ ‘ ๋‹ค์šด๋กœ๋“œ: https://code.visualstudio.com/#alt-downloads
  • brew๋ฅผ ์ด์šฉํ•œ ์„ค์น˜: https://polarcompass.tistory.com/140?category=514165

1.2 VSCode Extension ์„ค์น˜

1.2.1 C++ Extension ์„ค์น˜

C++ extension ์„ค์น˜

1.2.2 CodeLLDB ๋””๋ฒ„๊น… Extension ์„ค์น˜

CodeLLDB

1.3 Clang ์„ค์น˜ ๋ฐ ํ™•์ธ

ํ„ฐ๋ฏธ๋„ ์ฐฝ์— ์•„๋ž˜ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์—ฌ clang์ด M1์— ์„ค์น˜๋˜์–ด ์žˆ๋‚˜ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

$ clang --version

๋งŒ์•ฝ, ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š์œผ๋ฉด ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ xcode๋ฅผ ์„ค์น˜ํ•˜๋ฉด ํ•ด๊ฒฐ๋ฉ๋‹ˆ๋‹ค.

$ xcode-select --install

2. ๋””๋ฒ„๊น… ํ™˜๊ฒฝ ์„ธํŒ…

ํด๋” ์ด๋ฆ„์„ ๋ณธ์ธ์ด ์›ํ•˜๋Š” ์ด๋ฆ„์œผ๋กœ ์ƒ์„ฑํ•˜๊ณ , ๋‚ด๋ถ€์— ๊ธฐ๋ณธ cpp ํŒŒ์ผ ์™ธ ์•ž์œผ๋กœ ๋‹ค์Œ ์„ธ๊ฐœ์˜ ํŒŒ์ผ์„ ์…‹ํŒ…ํ•˜๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ํ•œ๋‹ค.

  •  tasks.json  - complier build settings
  •  launch.json - debugger settings
  •  c_cpp_properties.json  - complier path and IntelliSense settings

์ดํ›„์— ์ƒˆ๋กœ์šด ํด๋”๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ์œ„์˜ ์„ธ๊ฐœ ํŒŒ์ผ์„ ๋ณต์‚ฌํ•ด์„œ ๋ถ™์—ฌ๋„ฃ์œผ๋ฉด ๋™์ผํ•œ ์„ธํŒ…๊ฐ’์œผ๋กœ ๊ฐœ๋ฐœ์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

2.1 cpp ํŒŒ์ผ ์ƒ์„ฑ

์™ผ์ชฝ ๋ฐ”์˜ ํ•˜๋‹จ ๊ทธ๋ฆผ์˜ ์œ„์น˜์˜ ์•„์ด์ฝ˜์„ ํด๋ฆญํ•˜์—ฌ test.cpp๋ผ๋Š” ์ด๋ฆ„์œผ ์ƒˆ๋กœ์šด ํŒŒ์ผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

ํŒŒ์ผ์ œ๋ชฉ.cpp ์ƒ์„ฑ

์ดํ›„ ํŒŒ์ผ ๋‚ด๋ถ€์— ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ๋ณต๋ถ™ํ•œ ํ›„ Ctrl + S ๋กœ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

#include <iostream>
using namespace std;

int main()
{
    cout << "HelloWorld\n";
}

2.2 Build test.cpp: tasks.json ํŒŒ์ผ ์ƒ์„ฑ

test.cpp๋ฅผ build ํ•˜๊ธฐ ์œ„ํ•˜์—ฌ tasks.json ํŒŒ์ผ์„ ์ƒ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ์œ„ํ•ด VSCode ๋‚ด์˜ ์ƒ๋‹จ๋ฐ” ๋ฉ”์ธ ๋ฉ”๋‰ด์—์„œ Terminal(ํ„ฐ๋ฏธ๋„) > Configure Default Build Task(๊ธฐ๋ณธ ๋นŒ๋“œ ์ž‘์—… ๊ตฌ์„ฑ...) ๋กœ ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค. ์ดํ›„ C/C++ clang++ build active file ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

tasks.json ๊ฐ€ ์ƒ์„ฑ๋˜๋ฉด ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ๋ณต๋ถ™ํ•ฉ๋‹ˆ๋‹ค.

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "type": "shell",
      "label": "clang++ build active file",
      "command": "/usr/bin/clang++",
      "args": [
        "-std=c++17",
        "-stdlib=libc++",
        "-g",
        // ํ˜„์žฌ VSCode ์ƒ ํ”„๋กœ์ ํŠธ ํด๋”๊ฐ€ ${workspaceFolder}์ด๋ฉฐ ์ด๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์‹คํ–‰ ํŒŒ์ผ์˜ ์œ„์น˜๋ฅผ ๊ธฐ์žฌ
        "${workspaceFolder}/dp/RGBDistance.cpp",
        "-o",
        "${fileDirname}/${fileBasenameNoExtension}"
      ],
      "options": {
        "cwd": "${workspaceFolder}"
      },
      "problemMatcher": ["$gcc"],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}

์ดํ›„ test.cpp ํŒŒ์ผ๋กœ ๋Œ์•„์™€์„œ Cmd+Shift+B  ๋กœ ํŒŒ์ผ์„ build ํ•ฉ๋‹ˆ๋‹ค.

2.3 Execute & Debug test.cpp: launch.json ํŒŒ์ผ ์ƒ์„ฑ

๋‹ค์Œ์€ launch.json ์„ ๋งŒ๋“ค์–ด์ค€๋‹ค. Fn + F5 ๋ˆŒ๋Ÿฌ debug๋ฅผ ์‹คํ–‰ํ•ด์ค๋‹ˆ๋‹ค. ์ด๋ฅผ ์œ„ํ•ด VSCode ๋‚ด์˜ ์ƒ๋‹จ๋ฐ” ๋ฉ”์ธ ๋ฉ”๋‰ด์—์„œ Run > Add Configuration... ์„ ์„ ํƒํ•œ ํ›„ C++ (GDB/LLDB) ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ๊ทธ ๋‹ค์Œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์„ ํƒ์ง€๋ฅผ ๋ณด๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๊ทธ ํ›„  launch.json ํŒŒ์ผ์ด ์ƒ์„ฑ ๋œ ํ›„ ์•„๋ž˜์™€ ๊ฐ™์€ ์ฝ”๋“œ ๋ณต๋ถ™ํ•ฉ๋‹ˆ๋‹ค.

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "clang++ - Build and debug active file",
      "type": "lldb",
      "request": "launch",
      "program": "${fileDirname}/${fileBasenameNoExtension}",
      "args": [],
      "stopAtEntry": true,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "externalConsole": false,
      "MIMode": "lldb",
      "preLaunchTask": "clang++ build active file"
    }
  ]
}

โ€ป ์ฃผ์˜์ 

tasks.json ์˜ label ๋ถ€๋ถ„๊ณผ launch.json์˜ preLaunchTask ๋ถ€๋ถ„ ์ด๋ฆ„์ด ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค. launch.json์„ ์ฝ๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์ด๋Š”๋ฐ, launch.json ๋‚ด๋ถ€์˜ preLaunchTask์™€ ๊ฐ™์€ tasks.json ๋‚ด๋ถ€์˜ label์„ ์ฐพ์•„์„œ ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค. 

tasks.json

"label": "clang++ build active file",

launch.json

"preLaunchTask": "clang++ build active file"

ํ•œ๊ธ€๋กœ ๋˜์–ด์žˆ์„ ๊ฒฝ์šฐ์—” ๋˜๋„๋ก ์˜์–ด๋กœ ๋ฐ”๊ฟ” ์ฃผ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

2.4 C/C++ configuration ์„ธํŒ…

์ด์ œ c_cpp_properties.json ํŒŒ์ผ ์„ธํŒ… ํ•˜๊ธฐ ์œ„ํ•ด Ctrl+Shift+P ๋‹จ์ถ•ํ‚ค๋กœ Command Palette ์—ด์–ด์ค๋‹ˆ๋‹ค.

์ดํ›„ C/C++:Edit Configurations (UI) ๋กœ UI ํ˜•ํƒœ๋กœ ์„ธํŒ…ํ•˜๊ฑฐ๋‚˜ C/C++:Edit Configurations (JSON) ์œผ๋กœ ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ๋ณต๋ถ™ํ•ฉ๋‹ˆ๋‹ค.

{
  "configurations": [
    {
      "name": "Mac",
      "includePath": ["${workspaceFolder}/**"],
      "defines": [],
      "macFrameworkPath": [
        "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
      ],
      "compilerPath": "/usr/bin/clang",
      "cStandard": "c11",
      "cppStandard": "c++17",
      "intelliSenseMode": "clang-x64"
    }
  ],
  "version": 4
}

3. ๋‚˜์˜ ๋””๋ฒ„๊น… ์„ธํŒ…

3.1 tasks.json

ํŠน์ • ์œ„์น˜์—์„œ ํŒŒ์ผ์„ ์‹คํ–‰์‹œ์ผฐ์„ ๋•Œ, Debug/ ํด๋” ๋‚ด๋ถ€์— ๋ฐ”์ด๋„ˆ๋ฆฌ ์‹คํ–‰ํŒŒ์ผ ๋ฐ *.dSYM/ ํด๋”๋ฅผ ๋„ฃ๋„๋ก ๊ตฌ์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค.

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "type": "shell",
      "label": "clang++ build active file",
      "command": "/usr/bin/clang++",
      "args": [
        "-std=c++17",
        "-stdlib=libc++",
        "-g",
        "${file}",
        "-o",
        "Debug/${fileBasenameNoExtension}"
      ],
      "options": {
        "cwd": "${workspaceFolder}"
      },
      "problemMatcher": ["$gcc"],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}
  • "${workspaceFolder}/dp/RGBDistance.cpp" -> "${file}"
  • "Debug/${fileBasenameNoExtension}" -> "Debug/${fileBasenameNoExtension}"
  • ์ฐธ๊ณ : https://code.visualstudio.com/docs/editor/variables-reference

3.2 launch.json

Debug/ ํด๋” ๋‚ด๋ถ€์— ๋ฐ”์ด๋„ˆ๋ฆฌ ์‹คํ–‰ํŒŒ์ผ์„ ์ฐพ์•„์„œ ์‹คํ–‰ํ•˜๋„๋ก ๊ตฌ์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
      {
        "name": "clang++ - Build and debug active file",
        "type": "lldb",
        "request": "launch",
        "program": "Debug/${fileBasenameNoExtension}",
        "args": [],
        "stopAtEntry": true,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "lldb",
        "preLaunchTask": "clang++ build active file"
      }
    ]
}

์ฐธ๊ณ 

  • [VSCode] Using Clang in Visual Studio Code: https://code.visualstudio.com/docs/cpp/config-clang-mac
  • [VSCode] Variables Reference(Predefined): https://code.visualstudio.com/docs/editor/variables-reference 
  • [Blog] ๋งฅ๋ถ M1 VSCODE C++ ์„ค์ • ํ™˜๊ฒฝ ์„ค์ • ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ธํŒ… AppleSilicon: https://polarcompass.tistory.com/12  
๋ฐ˜์‘ํ˜•
์ €์ž‘์žํ‘œ์‹œ ๋น„์˜๋ฆฌ ๋ณ€๊ฒฝ๊ธˆ์ง€ (์ƒˆ์ฐฝ์—ด๋ฆผ)

'Study: DeveloperTools(DevTool) > DevTool: IDE' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[IDE] VSCode Springboot ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ค์ • (MacOS M1)  (0) 2023.01.21
[IDE] VSCode React + .Net ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ค์ • (MacOS M1)  (0) 2023.01.16
[IDE] VSCode C++ ๋””๋ฒ„๊น… ํ™˜๊ฒฝ ์„ธํŒ…(task.json, launch.json): GCC on Linux (feat. ๋ชจ๋“  ์ค‘๋‹จ์ ์—์„œ ๋ฉˆ์ถ”๋„๋ก)  (1) 2022.07.08
[IDE] VSCode ์œ ์šฉํ•œ Extension ์ •๋ฆฌ  (0) 2022.06.09
[IDE] Visual Studio ์ค„๋ ๊ณ ๊ธ‰ ์ €์žฅ ์˜ต์…˜  (0) 2020.09.08
    'Study: DeveloperTools(DevTool)/DevTool: IDE' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
    • [IDE] VSCode Springboot ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ค์ • (MacOS M1)
    • [IDE] VSCode React + .Net ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ค์ • (MacOS M1)
    • [IDE] VSCode C++ ๋””๋ฒ„๊น… ํ™˜๊ฒฝ ์„ธํŒ…(task.json, launch.json): GCC on Linux (feat. ๋ชจ๋“  ์ค‘๋‹จ์ ์—์„œ ๋ฉˆ์ถ”๋„๋ก)
    • [IDE] VSCode ์œ ์šฉํ•œ Extension ์ •๋ฆฌ
    DrawingProcess
    DrawingProcess
    ๊ณผ์ •์„ ๊ทธ๋ฆฌ์ž!

    ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”