zoukankan      html  css  js  c++  java
  • vscode C语言cl编译器调试配置

    microsoft 出品的 cl编译器运行/调试c配置,cl.exe 通过visual studio c ++ build tools 安装:

    launch.json:

     1 {
     2     "version": "0.2.0",
     3     "configurations": [
     4         {   // 对应cl.exe
     5             "name": "cl.exe build and debug active file",
     6             "type": "cppvsdbg",
     7             "request": "launch",
     8             "program": "${cwd}\out\${fileBasenameNoExtension}.exe",
     9             "args": [],
    10             "stopAtEntry": false,
    11             "cwd": "${workspaceFolder}",
    12             "environment": [],
    13             "externalConsole": true,
    14             "preLaunchTask": "cl.exe build active file",
    15             "logging": {    // 用于消除PDB文件找不到打不开问题,来自于https://none53.hatenablog.com/entry/2019/11/28/vsCode_Cannot_find_or_open_the_PDB_file.
    16                 "moduleLoad": false
    17             },
    18             "presentation": {
    19                 "focus": true
    20             }
    21         }
    22     ]
    23 }

    tasks.json: 需要在项目根目录建 out 文件夹

     1 {
     2     "version": "2.0.0",
     3     "tasks": [
     4         {    // 对应cl.exe
     5             "type": "shell",
     6             "label": "cl.exe build active file",
     7             "command": "cl.exe",
     8             "args": [    // cl的编译选项,自行设置
     9                 "/Zi",
    10                 "/EHsc",
    11                 "/Fe:",
    12                 "${cwd}\out\${fileBasenameNoExtension}.exe",
    13                 "/Fo:",
    14                 "${cwd}\out\${fileBasenameNoExtension}.obj",
    15                 "${file}"
    16             ],
    17             "group": {
    18                 "kind": "build",
    19                 "isDefault": true
    20             },
    21             "presentation": {
    22                 "reveal": "always"
    23             },
    24             "problemMatcher": "$msCompile"
    25         },
    26     ]
    27 }

    Windows 环境变量 - >系统变量新建:

    INCLUDE

    值(按实际情况设置填值,这里是笔者安装Visual Studio 2019后的值):

    C:Program Files (x86)Windows Kits10Include10.0.18362.0ucrt;C:Program Files (x86)Windows Kits10Include10.0.18362.0um;C:Program Files (x86)Windows Kits10Include10.0.18362.0winrt;C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.27.29110include;C:Program Files (x86)Windows Kits10Lib10.0.18362.0ucrtx64;

    LIB

    值(按实际情况设置填值,这里是笔者安装Visual Studio 2019后的值):

    C:Program Files (x86)Windows Kits10Lib10.0.18362.0ucrtx64;C:Program Files (x86)Windows Kits10Lib10.0.18362.0umx64;C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.27.29110libx64;

  • 相关阅读:
    超酷幽默搞笑的摄影作品
    免费素材:超棒的PSD格式UI套件 Soft UI KIT
    【简报】使用3D过渡效果的图片幻灯:Adaptor
    一个超棒的CSS属性排序工具 CSScomb
    GBin1专题之Web热点#5
    一个超棒的消息提示jQuery插件 Noty
    分享12个超棒的免费PSD格式UI套件
    分享11个超棒的移动应用(mobile apps)开发解决方案
    超棒的仪表盘javascript类库 justGage
    为什么使用Dojo toolkit的十大原因
  • 原文地址:https://www.cnblogs.com/Joynic/p/13743509.html
Copyright © 2011-2022 走看看