visual-studio-code - 在 Visual Studio Code 中将 VS 的 Developer Command Prompt 设置为默认值

标签 visual-studio-code visual-c++

这个技巧看起来很简单,但我不知道如何设置,
我做了什么 :
转到存档 > 首选项 > 用户配置。
在右边的面板中我写了这个......

{
    "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/

相关文章:

visual-studio-code - VSCode 终端智能感知

c++ - 用于分析库文件中符号的实用程序

python - 所有项目文件上的 vscode pylint 无需打开它们

TypeScript 隐含了 Superagent 的任何错误

c# - 如何在 Visual Studio Code 中使用单元测试构建 asp.net 5 dnx 项目?

visual-studio-code - 搜索(在文件中查找)键绑定(bind)可以带参数,workbench.view.search 不能 - 其他区别?

c++ - 如何在 PC/Visual C++ 上查明指针是否在堆栈上

c++ - 对 Windows HANDLE 使用 std::unique_ptr

c++ - 如何从文件中只读取一行

c++ - 图形生成器未发布,渲染在后台