mac +vscode c++使用时的三个配置文件
vscodec++编译时 三个配置文件,c_cpp_properties.json:引用库文件配置(ctrl + shift + P)
task.json: 编译器配置
launch.json: 任务配置
以下3个是本人mac上的,亲测可行。供大家参考。
c_cpp_properties.json:
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"~/Desktop/c++/include"
],
"defines": [],
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
launch.json:
"version": "0.2.0",
"configurations": [
{
"name": "c++Compiler",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb"
}
]
tasks.json
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "g++",
"args": ["myprj/src/myPrjMain.cpp",
"myprj/src",
"myprj/include"],
"group": {
"kind": "build",
"isDefault": true
}
}
]

浙公网安备 33010602011771号