如何编写运行 vcvars32.bat 的构建批处理脚本,然后继续构建? [英] How do I write a build batch script that runs vcvars32.bat, and then continues with the build?

查看:57
本文介绍了如何编写运行 vcvars32.bat 的构建批处理脚本,然后继续构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个简单的批处理脚本,使用 vcvars32.bat 加载 Visual Studio 构建环境,然后使用 vcbuild 继续构建.但是,我的脚本不会在调用 vcvars32.bat 之后执行.我得到的最后输出是:

I want to write a simple batch script that loads the Visual Studio build environment using vcvars32.bat and then continue with the build, using vcbuild. However, my script won't execute past the invocation of vcvars32.bat. The last output I get is:

Setting environment for using Microsoft Visual Studio 2008 x86 tools.

如您所见,我使用的是 Visual Studio 2008.这是我最简单的批处理脚本:

As you can see I'm using Visual Studio 2008. Here is my simplest batch script:

@echo off
"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
vcbuild

推荐答案

你必须在你的批处理脚本中使用 call ,否则 vcvars32.bat 的终止将终止你自己的批处理脚本.因此你的脚本应该是:

You have to use call in your batch script, or the termination of vcvars32.bat will terminate your own batch script. Therefore your script should be:

@echo off
call "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
vcbuild

这篇关于如何编写运行 vcvars32.bat 的构建批处理脚本,然后继续构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆