Configuring cl CMD compiling Windows

2019-09-14 08:32发布

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.

1条回答
做自己的国王
2楼-- · 2019-09-14 08:55

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.

查看更多
登录 后发表回答