在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
microsoft 出品的 cl编译器运行/调试c配置,cl.exe 通过visual studio c ++ build tools 安装:
launch.json:
2021-08-22:新版本vscode 已经将 externalConsole 配置项标记为废弃,更换为使用使用: "console": "integratedTerminal", 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 "console": "integratedTerminal",
tasks.json: 需要在项目根目录建 out 文件夹 1 { 2 "version": "2.0.0", 3 "tasks": [ 4 { 5 "type": "shell", 6 "label": "cl.exe build active file", 7 "command": "cl.exe", 8 "args": [ 9 "/Zi", 10 "/source-charset:utf-8", // 源文件编码,加上此行可以在文件中写中文注释也不会有IDE warning信息 11 "/EHsc", 12 "/Fe:", 13 "${cwd}\\out\\${fileBasenameNoExtension}.exe", 14 "/Fo:", 15 "${cwd}\\out\\${fileBasenameNoExtension}.obj", 16 "${file}" 17 ], 18 "group": { 19 "kind": "build", 20 "isDefault": true 21 }, 22 "presentation": { 23 "reveal": "always" 24 }, 25 "problemMatcher": "$msCompile" 26 } 27 ] 28 }
Windows 环境变量 - >系统变量新建: INCLUDE 值(按实际情况设置填值,这里是笔者安装Visual Studio 2019后的值):
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;
LIB 值(按实际情况设置填值,这里是笔者安装Visual Studio 2019后的值):
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\lib\x64;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论