配置代码如下
properities
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "D:/Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
task
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "D:/Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
错误提示
> Executing task: C/C++: cl.exe 生成活动文件 <
正在启动生成...
cl.exe /Zi /EHsc /nologo /Fe: a1.exe a1.cpp
'cl.exe' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�����������
生成已完成,但出现错误.
终端进程启动失败(退出代码: -1)。
终端将被任务重用,按任意键关闭。
当我使用 vs2019 的 devtools 输入cl a1.cpp的时候,a1.exe 和 a1.obj 正常生成和运行,但当使用 vscode 内的 ctrl+shift+b 的时候显示上述错误信息
参考的教程 https://blog.csdn.net/qq_38981614/article/details/99629597