
답변1
C++를 지원하는 IDE를 설치합니다. Visual Studio Code는 모든 기능을 갖춘 코드 편집기이지만 Visual Studio와 같은 IDE는 아닙니다. C++를 지원하는 일반적으로 사용되는 IDE라면 모두 가능합니다. XCode는 C++ 컴파일러가 내장된 매우 깔끔한 IDE이므로 클릭 한 번으로 C++를 작성하고 컴파일하고 실행할 수 있습니다.
답변2
아래 구성을 사용하여 MacOS의 VSCODE에서 C++17 코드를 빌드할 수 있습니다.
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "clang++ build active file",
"command": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++",
"args": [
"-g",
"${file}",
"-std=c++17",
"--debug",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"
},
"problemMatcher": [
"$gcc"
]
}
]
}
답변3
macOS의 VSCode에서 C++ 코드를 빌드하고 디버그하려면 다음을 따라야 합니다.이 튜토리얼
그러면 c_cpp_properties.json(프로젝트 폴더의 .vscode 폴더 내)은 다음과 같아야 합니다(YOURUSERNAME을 macOS 사용자 이름으로 대체).
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"/Users/YOURUSERNAME/bin/CPP_Libraries/Eigen/Eigen/**"
],
"defines": [],
"macFrameworkPath": ["/System/Library/Frameworks",
"/Library/Frameworks"],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}