4

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.

4

6 回答 6

7

我在这里记录了您链接中最重要的部分- 微软有一个坏习惯,就是移动东西并留下死链接。这不仅是最重要的一点,而且它提供了足够的信息来进行搜索,如果/何时移动它。

从命令行构建项目

您可以从命令行生成 Visual C++ 项目,而无需先导出生成文件(MAKEFILE 或 filename.mak)并使用 NMAKE 实用程序。

基本的命令语法是

msdev FileName [/MAKE "ProjectName – ConfigName | ALL"] [/REBUILD /CLEAN /NORECURSE /OUT LogFile /USEENV]

其中 FileName 是您的项目 (.dsp) 或工作区 (.dsw) 文件的名称。

于 2008-09-26T22:01:35.810 回答
5

I think I found m answer here: http://msdn.microsoft.com/en-us/library/aa699274.aspx

thanks all

于 2008-09-26T21:00:54.597 回答
0

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:

:::::::: CompileSolution :::::::::::::::::::::::::

call X:\BuildTools\bin\BuildVbProj.bat %COMPONENTNAME% %SOLUTIONDIR% %PROJFILE% %BUILDOUTPUTFILE% %PREBUILDFILE% if %ERRORLEVEL% NEQ 0 goto BuildErrors

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.

于 2008-09-26T20:54:00.730 回答
0

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.

于 2008-09-26T20:56:51.097 回答
0

Microsoft 提供了用于构建 Visual Studio 项目的命令行驱动程序。在 VC6 中,它被称为“msdev”(执行 msdev /? 以获得选项列表)。

在某个时候(可能是 VS.NET/VS 2002),出于某种原因,他们开始调用命令行构建驱动程序“devenv”。它有一些不同的语法,但对于驱动构建,选项是相同或相似的。

于 2008-09-26T21:46:02.993 回答
-2

另一种劳动强度较低的选择是


下拉菜单 (BUILD)
选择 (BATCHBUILD)
按钮 (REBUILDALL)

于 2008-09-27T21:38:29.227 回答