本文主要是介绍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"}
这篇关于VSCode使用MSVC编译器的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!