这个技巧看起来很简单,但我不知道如何设置,
我做了什么 :
转到存档 > 首选项 > 用户配置。
在右边的面板中我写了这个......
{
"terminal.integrated.shell.windows":
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\VsDevCmd.bat"
}
工作直到突然消失。思考一个
launch.json
脚本只是为了不写在控制台上并使用播放按钮,我知道 cl
用于调用编译器但不知道如何处理参数。有人建议使用Cmake。我想要的只是使用 VC/C++ 编译器(不限于 2017 版本,可以是任何版本)运行暂存代码,因此任何解决方案都将受到高度赞赏。
最佳答案
尝试这个
{
"terminal.integrated.shell.windows": "C:\\Windows\\Sysnative\\cmd.exe",
"terminal.integrated.shellArgs.windows": ["/k", "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat"]
}
似乎您需要使用 cmd 作为 shell 程序,但传入/k 和为 dev 命令提示符设置适当环境变量的批处理脚本。
顺便说一句,我的命令提示符是针对 Visual Studio 2015 的,你需要更新你的版本,看起来像 2017。
关于visual-studio-code - 在 Visual Studio Code 中将 VS 的 Developer Command Prompt 设置为默认值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41986112/