其他分享
首页 > 其他分享> > macbook m1实现vscode下debug(解决无法读入的问题)

macbook m1实现vscode下debug(解决无法读入的问题)

作者:互联网

需要下载的

需要开启的

需要新建的

#include <iostream>
using namespace std;

int main()
{
    int a = -1;
    cin >> a;
    cout << a + 100 << endl;

    return 0;
}
{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-clang-arm64"
        }
    ],
    "version": 4
}
{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "cppbuild",
			"label": "cpp",
			"command": "/usr/bin/clang++",
			"args": [
				"-fcolor-diagnostics",
				"-fansi-escape-codes",
				"-g",
				"${file}",
				"-o",
				"${fileDirname}/${fileBasenameNoExtension}"
			],
			"options": {
				"cwd": "${fileDirname}"
			},
			"problemMatcher": [
				"$gcc"
			],
			"group": "build",
			"detail": "编译器: /usr/bin/clang++"
		}
	]
}
{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "cwd": "${workspaceFolder}",
            "preLaunchTask": "cpp"
        }
    ]
}

剩余工作

标签:vscode,json,clang,cpp,点击,m1,debug,command
来源: https://www.cnblogs.com/solego/p/16651775.html