VC 6 的命令行构建?
我已经习惯使用 VS2005 和 2008 - 使用 msbuild 等,但我继承了一组项目,这些项目目前必须保留在 vc6.0 中。 我不喜欢在开发者工作室和大楼中打开每个项目。 我更喜欢构建表单命令行(我正在自动化构建)。 这可能吗?
我已经尝试过 nmake 实用程序,但我仍然需要打开项目并保存/导出 make 文件。 如果项目发生变化,这会很乏味——每次我都必须保存 make 文件。 nmake 似乎可以工作,但是当我更改目录树中项目的位置时出现问题(我从 svn 签出到一个新的干净目录以尝试构建)。 它似乎有硬编码的路径,但我必须检查一下 - 这可能是一个不同的问题。
还有其他选择吗?
最终我会将这些迁移到 2008 年,但目前这不是一个选择。
I have been used to working with VS2005 and 2008 - using msbuild, etc, but I have inherited a set of projects that have to remain in vc6.0 for now. I don't like opening each project in the developer studio and building. I prefer to build form command line (I am automating the builds). Is this possible?
I have tried the nmake utility, but I still need to open up the projects and save/export the make file. This is tedious if the project changes - each time I have to save the make file. nmake seems to work, but it had a problem when I changed the location of the project in my directory tree (I checked out of svn into a new clean dir to try the build). It seemed to have hard coded paths in it, but I will have to check on that - it might have been a different problem.
Any alternatives out there?
Eventually I will migrate these to 2008, but for now that is not an option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我在这里记录了您的链接的最重要部分 - Microsoft有一个坏习惯,就是到处移动东西并留下死链接。 这不仅是最重要的一点,而且如果/当他们移动它时,它提供了足够的信息来进行搜索。
从命令行构建项目
您可以从命令行构建 Visual C++ 项目,而无需先导出 makefile(MAKEFILE 或 filename.mak)并使用 NMAKE 实用程序。
基本命令语法为
msdev FileName [/MAKE "ProjectName – ConfigName | ALL"] [/REBUILD /CLEAN /NORECURSE /OUT LogFile /USEENV],
其中 FileName 是项目 (.dsp) 或工作区 (.dsw) 文件的名称。
I'm recording the most important part of your link here - Microsoft has a bad habit of moving stuff around and leaving dead links. Not only is this the most important bit, but it gives enough information to do a search if/when they move it.
Building a Project from the Command Line
You can build a Visual C++ project from the command line without first exporting a makefile (MAKEFILE, or filename.mak) and using the NMAKE utility.
The basic command syntax is
msdev FileName [/MAKE "ProjectName – ConfigName | ALL"] [/REBUILD /CLEAN /NORECURSE /OUT LogFile /USEENV]
where FileName is the name of your project (.dsp) or workspace (.dsw) file.
当然你可以自动化。 我已经很多年没有使用过 vc 了,但我认为编译器叫做 c8.exe 或哇,我不再记得像这样的愚蠢的小花絮了,但是在你的 vc\bin 目录中查看所有的 exe,它将是从名字上就很明显了。
最坏的情况你可以写一个批处理文件。 但我还记得用户界面有一个“创建 makefile”功能。 因此,您只需执行一次,然后从命令行运行 make 即可。 或者也许是 nmake。 又是好久好久了。
of course you can automate. I haven't used vc in years, but I think the compiler is called c8.exe or wow, I can't remember silly little tidbits like that anymore, but look in your vc\bin directory at all the exes and it will be obvious by name.
you can write a batch file worst case. But I also remember the UI having a "create makefile" function. So you do that once, and then just run make from the command line and voila. or maybe it's nmake. Again, been a long long time.
我想我在这里找到了答案:
http://msdn.microsoft.com/en-us/library/aa699274.aspx
谢谢大家
I think I found m answer here:
http://msdn.microsoft.com/en-us/library/aa699274.aspx
thanks all
我们在我的工作场所使用自动化构建。 本质上只是我从命令行启动的一个批处理文件。 在我继续发布之前,请确保我可以发布一些示例代码。 但是,是的,自动化构建是可能的。
示例代码:
goto Cleanup
编辑: BuildVbProj.bat 文件最终调用 Program Files\MS Visual Studio\VB98\ 文件夹中的 VB6.exe。 尝试用“VB6.exe /?”来调用它 或“VB6.exe -?” 它会显示一个选项列表。 您基本上可以使用这些选项来自动化您的流程。
VC98 文件夹中也应该有一个类似的 VC exe。
We use automated builds at my work place. Essentially just a batch file i fire off from the command line. Let me make sure i am allowed to post some sample code before i go ahead and post it. But yes, it IS possible to automate the build.
Sample Code:
goto Cleanup
EDIT: The BuildVbProj.bat file ultimately calls VB6.exe in the Program Files\MS Visual Studio\VB98\ folder. Try calling it with "VB6.exe /?" or "VB6.exe -?" and it will show you a list of options. You can basically automate your process using those options.
There should be a similar exe for VC in the VC98 folder as well.
Microsoft 提供了用于构建 Visual Studio 项目的命令行驱动程序。 在 VC6 中,它称为“msdev”(执行 msdev /? 以获得选项列表)。
在某些时候(可能是 VS.NET/VS 2002),他们出于某种原因开始调用命令行构建驱动程序“devenv”。 它的语法有些不同,但对于驱动构建来说,选项是相同或相似的。
Microsoft provides a command line driver for building Visual Studio projects. In VC6 it's called "msdev" (do msdev /? for a list of options).
At some point (probably VS.NET/VS 2002) they started calling the command line build driver "devenv" for some reason. It has a somewhat different syntax, but for driving builds the options are the same or similar.
另一种劳动密集度较低的选项是
下拉菜单(BUILD)
选择 (BATCHBUILD)
按钮(重建)
Another option which is less labor intensive is
Pulldown Menu (BUILD)
Select (BATCHBUILD)
Push Button (REBUILDALL)