配置cl CMD编译Windows [英] Configuring cl CMD compiling Windows
问题描述
我已经在MSDN.com上阅读了要通过cl命令启用命令行编译的信息,您必须运行vcvarsall.bat文件。我已经在CMD中运行了该文件,并使用cl命令编译了代码。问题是,我离开CMD并重新打开它之后,我不再具有使用cl的能力,并且每次重新打开CMD时都不得不重新运行vcvarsall.bat。有什么方法可以避免这样做?谢谢。
只需在桌面上创建一个调用
<$的快捷方式p $ p>
cmd / k%VS140COMNTOOLS%\vsvars32.bat
调整环境变量和批处理文件名以适合您安装的VS版本号。在上面的示例中,这将与Visual Studio 2015一起使用。
I have already read on MSDN.com that to enable command line compilation through the cl command you have to run the vcvarsall.bat file. I have run this file in CMD and compiled code using the cl command. The issue is that after I leave the CMD and reopen it, I no longer have the ability to use cl and have to rerun vcvarsall.bat every time I reopen CMD. Is there any way to avoid having to do this? Thanks.
Just create a shortcut on your desktop that calls
cmd /k "%VS140COMNTOOLS%\vsvars32.bat"
Adapt the environment variable and batch file name to fit your installed VS version number. In the example above, this will work with Visual Studio 2015.
这篇关于配置cl CMD编译Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!