VSCode使用MSVC编译器

1.其他大佬的配置:下载和安装库环境
2.安装好C/C++插件<选择1.8.4的版本最好>。
3.分别生成对应的默认模板即可。但是其中参数可能需要配置。
task.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "cppbuild",
			"label": "C/C++: cl.exe build active file",
			"command": "cl.exe",
			"args": [
				"/Zi",
				"/EHsc",
				"/nologo",
				"/Fe:",
				"${fileDirname}\\${fileBasenameNoExtension}.exe",
				"${file}"
			],
			"options": {
				"cwd": "${fileDirname}"
			},
			"problemMatcher": [
				"$msCompile"
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"detail": "compiler: cl.exe"
		}
	]
}

launch.json

{
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(Windows) Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [
            ],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "console":"integratedTerminal"
        },
        
        
    ],
    "preLaunchTask": "C/C++: cl.exe build active file"
    
}

相关推荐

  1. VSCode使用MSVC编译器

    2024-03-22 07:40:02       17 阅读
  2. 浅谈微软的编译器MSVC

    2024-03-22 07:40:02       15 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-22 07:40:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-22 07:40:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-22 07:40:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-22 07:40:02       18 阅读

热门阅读

  1. 导入excel复杂校验加异常信息返回

    2024-03-22 07:40:02       16 阅读
  2. 并网型风光储微电网日前优化调度(MATLAB实现)

    2024-03-22 07:40:02       14 阅读
  3. 物联网如何推动工业自动化的发展和变革

    2024-03-22 07:40:02       19 阅读
  4. 关于Windows 10 LTSC 2019无法安装Edge的解决方案

    2024-03-22 07:40:02       32 阅读
  5. macOS 合并同名文件夹 按住 Option 键

    2024-03-22 07:40:02       18 阅读
  6. React核心⼊⻔-lesson1

    2024-03-22 07:40:02       17 阅读