内容纲要
  1. code.visualstudio.com下载mac版vscode

  2. 安装并运行vscode,安装插件c/c++和clang++

  3. 安装xcode

  4. 新建并打开一个c程序文件夹,并新建编写一个c程序,fn+F5调试,在弹出的launch.json里新增:preLaunchTask:make&run

    修改:

    program:${file}
  5. 回到c程序,在此按下fn+F5,在弹出窗口选择新建任务,选择Others模板

    在task.json里编写如下

    { 
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format 
    version: 2.0.0, 
    tasks: [ 
        { 
            label: make&run, 
            command: gcc, 
            type: shell, 
            args: [ 
                -g,${file},
                -o, ${file}.out ], 
            presentation: { 
                echo: true, 
                reveal: always, 
                focus: false, 
                panel: shared 
            }
        } 
    ] 
    }

    Done.

Leave a Reply

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据