【转】msdev & devenv 的命令行用法(以编译BerkeleyDB为例) 收藏

【转】msdev & devenv 的命令行用法(以编译BerkeleyDB为例) 收藏
最近编译chrome,vs打开chrome后不停地更新智能提示,很占资源,所以查查在命令行编译vs工程的方法。最近wince工程也要自动编译,所以也需要在命令行编译vddproj文件。

转自:http://blog.chinaunix.net/u2/89624/showart_1903053.html

 

msdev是visual studio 6.0的IDE程序, devenv是visual studio 2005的IDE程序
两种IDE程序, 既可以工作在图形模式下,也可以工作在命令模式下.
其中, 直接运行msdev 和 devenv将打开vs6和vs2005的IDE界面. 命令行则支持不同的选项.
Msdev的命令行用法:
Usage:
  MSDEV [myprj.dsp|mywksp.dsw]  - load project/workspace
        []            - load source file
        /?                      - display usage information
        /EX          - execute a VBScript macro
        /OUT          - redirect command line output to a file
        /USEENV                 - ignore tools.options.directories settings
        /MAKE [] [...]  - build specified target(s)
              [ - ]
              [[|ALL] - [DEBUG|RELEASE|ALL]]
              /CLEAN            - delete intermediate files but don't build
              /REBUILD          - clean and build
              /NORECURSE        - don't build dependent projects
比如我对BerkeleyDB而言, 4.7.25自带了一个Berkeley_DB.dsw, 此工程文件由包含很多的子项目.
编译所有项目Debug版本为:
  msdev Berkeley_DB.dsw /make "all - Win32 Debug x86"
其中有一个project有许多其他projects组成,就是build_all, 包含了C/C++的动态库,各种工具程序,还有各种示例程序. 编译此project Debug版本就为:
  msdev Berkeley_DB.dsw /make "build_all - Win32 Debug x86"
如果还想编译Java的动态库, 在vc6中设置好java后, 运行如下命令即可:
  msdev Berkeley_DB.dsw /make "db_java - Win32 Debug x86"
在工程文件外,还有一个用来衡量性能的程序, test_micro,编译该程序的命令为:
msdev test_micro.dsp /make "test_micro - Win32 Debug x86"
即,对于项目文件而言, 其只有一个project, 就是其本身.
对于自动化程序而言, msdev有一个弊端,就是程序返回值.  当项目文件/工程文件不存在的时候, msdev的返回值居然是0!, 和编译成功的一样, 也许msdev认为不存在就是成功吧.
devenv命令的格式就长了一点, 基本语法是:
devenv  [solutionfile | projectfile | anyfile.ext]  [switches]
比如, 为了方便VC2005以上的编译, BerkeleyDB将会同时提供vc6所用的dsw文件同时, 也会推出一个sln文件,这sln文件就是solutionfile
使用此文件编译BerekleyDB默认配置的Debug版本为:
devenv Berkeley_DB.sln /build "Debug|Win32"
只编译db的动态库则为:
devenv Berkeley_DB.sln /build "Debug|Win32" /project db
编译test_micro则复杂点,因为vc2005默认的project file是.vcproj的,而不是.dsp格式的,而test_micro只有.dsp格式的故而,需要先转化为.vcproj格式的, 可以用VCBuild工具:
VCBuild test_micro.dsp /upgrade
这样就产生了test_micro.vcproj
用devenv编译就是:
devenv test_micro.vcproj /build "Debug x86|Win32"
  之所有配置与上面不同在与, test_micro中是适用于VC6的配置, 转化过来以后, 配置是保留的.
与msdev不同, devenv将文件不存在视为编译失败. 更加适合程序处理.
附:devenv的命令行帮助
Microsoft (R) Visual Studio Version 8.0.50727.762.
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
Use:
devenv  [solutionfile | projectfile | anyfile.ext]  [switches]
The first argument for devenv is usually a solution file or project file.
You can also use any other file as the first argument if you want to have the
file open automatically in an editor. When you enter a project file, the IDE
looks for an .sln file with the same base name as the project file in the
parent directory for the project file. If no such .sln file exists, then the
IDE looks for a single .sln file that references the project. If no such single
.sln file exists, then the IDE creates an unsaved solution with a default .sln
file name that has the same base name as the project file.
Command line builds:
devenv solutionfile.sln /build solutionconfig [ /project projectnameorfile [ /projectconfig name ] ]
Available command line switches:
/Build        Builds the solution or project with the specified solution
        configuration. For example "Debug". If multiple platforms
        are possible, the configuration name must be enclosed in quotes
        and contain platform name. For example: "Debug|Win32".
/Clean        Deletes build outputs.
/Command    Starts the IDE and executes the command.
/Deploy        Builds and then deploys the specified build configuration.
/Edit        Opens the specified files in a running instance of this
        application. If there are no running instances, it will
        start a new instance with a simplified window layout.
/LCID        Sets the default language in the IDE for the UI.
/Log        Logs IDE activity to the specified file for troubleshooting.
/NoVSIP        Disables the VSIP developer's license key for VSIP testing.
/Out        Appends the build log to a specified file.
/Project    Specifies the project to build, clean, or deploy.
        Must be used with /Build, /Rebuild, /Clean, or /Deploy.
/ProjectConfig    Overrides the project configuration specified in the solution
        configuration. For example "Debug". If multiple platforms are
        possible, the configuration name must be enclosed in quotes
        and contain platform name. For example: "Debug|Win32".
        Must be used with /Project.
/Rebuild    Cleans and then builds the solution or project with the
        specified configuration.
/ResetAddin    Removes commands and command UI associated with the specified Add-in.
/ResetSettings    Restores the IDE's default settings, optionally resets to
        the specified VSSettings file.
/ResetSkipPkgs    Clears all SkipLoading tags added to VSPackages.
/Run        Compiles and runs the specified solution.
/RunExit    Compiles and runs the specified solution then closes the IDE.
/SafeMode    Launches the IDE in safe mode loading minimal windows.
/Upgrade    Upgrades the project or the solution and all projects in it.
        A backup of these files will be created as appropriate.  Please
        see Help on 'Visual Studio Conversion Wizard' for more
        information on the backup process.
Product-specific switches:
/debugexe    Open the specified executable to be debugged. The
        remainder of the command line is passed to this
        executable as its arguments.
/useenv        Use PATH, INCLUDE, LIBPATH, and LIB environment variables
        instead of IDE paths for VC++ builds.
To attach the debugger from the command line, use:
    VsJITDebugger.exe -p

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/chief1985/archive/2009/08/28/4491650.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用VS6.0(VC++ or other)打开或添加项目时出现[MSDEV.EXE-应用程序错误"0x5003eaed"指令引用的"0x0000000"内存,该内存不能为"read";"0x73d311c7"指令引用的"0x00000004"内存,该内存不能为"read" ],这个可能是VS6.0和OFFICE 2007有冲突的缘故,下面是解决办法: 首先去下载一个FileTool(http://download.microsoft.com/download/vc60ent/s1/6.0/w9xnt4/en-us/filetool.exe 下载后解压缩),下载过来是一个C++原始文件,需要通过VC编译一下产生一个 FileTool.dll 将这个插件复制到X:\Program Files\Microsoft Visual Studio\Common\MSDev98\AddIns 重新打开VC6,Tools->Customize->Add-ins and Macro Files,选中FileTool Developer Studio Add-in即可。 此时打开VC6会有一个浮动工具栏(A O),点击A就是添加文件到工程,点击O就是打开文件。是不是很怪啊,竟然做了一个插件进来,并没有对原先的冲突进行改进。 VC6.0和Visio两个软件有冲突,把Visio卸载掉即可,若卸载无效,可按下述方法添加一个宏程序补救。 概要 启动 @ @ OpenFile@@ @ 对话框中使用键盘快捷方式键 VisualC++ 中或从 文件 菜单导致以下错误: 0x5003eaed 上 DEVSHL.DLL 中访问冲突 (0xC0000005)。 DevShl.Dll 引用 0x0000000 上内存。 无法读取内存。 当您从菜单中选择, 单击会出现相同错误。 FileTool.exe 是示例替换 VisualC++ 使用 Developer Studio 对象模型中 打开 和 添加到项目 菜单项。 开发 VisualStudio 对象模型包含方法, 同时打开文件并向项目添加文件。 BuildProject 对象包含 AddFile 方法将文件添加到项目。 Documents 对象包含一个可打开到 DeveloperStudio 文件 打开 方法。 这些可用于宏或外接程序。 安装加载项 下载FileTool.exe 1. 运行 FileTool.Exe 来提取 VisualC++6.0 项目。 2. 生成在 VisualC++ 项目 发布 或 调试 配置中。 3. VisualC++, 中单击 工具 菜单中 自定义 。 4. 在 自定义 对话框中, 单击 Add - Ins and 宏文件 选项卡。 5. 单击 浏览 按钮并定位步骤 2 中生成 FileTool.dll 文件。 6. 单击 确定 以保存设置。 对于两个命令工具栏出现。 删除快捷键 加载外接后, 可以删除为菜单项, 停止 VisualC++ 并将其分配给两外接命令按照下面步骤快捷键: 1. 从 VisualC++ 工具 菜单, 单击 自定义 。 2. 在 自定义 对话框中, 单击 键盘 选项卡。 3. 从 类别 中选择 文件 。 4. 在命令窗口, 选择 FileOpen 。 5. 当前密钥 窗口, 中选择 CTRL+O 项, 然后单击 删除 。 6. 从 类别 中选择 项目 。 7. 在命令窗口, 选择 InsertFilesIntoProject 。 如果没有与其, 关联快捷方式请按照步骤 5 来删除它。 有默认为没有快捷键对该项。 8. 从 类别 中选择 加载项 。 9. 两加载命令 AddFileToProject 和 OpenFile 命令窗口中显示。 10. 选择 OpenFile 然后 按新快捷键密钥 框放置光标、 按快捷键或组合键, 要, 并单击 指派 。 11. 对其他命令重复上述步骤。 对于两个命令分配快捷键当前密钥窗口中显示。 您可能还希望删除菜单命令并插入其就地 AddIn 命令。 将新 AddIn 命令插入 MenuBar, 使用以下步骤: 1. 从 VisualC++ 工具 菜单, 单击 自定义 。 2. 单击 文件 菜单并拖动 Open 命令的 文件 弹出式注销, 然后释放它。 3. 单击 项目 菜单, 单击 添加到项目 和然后关闭的弹出 文件 命令拖释放它。 4. 在 自定义 对话框中, 选择 命令 选项卡。 5. 从 类别 列表框中选择 外接 。 6. 到 文件 菜单 OpenFile 命令拖放它由 Open 命令 vacated 空间中。 7. AddFileToProject 命令拖 到 AddProject@@@ 项目到 项目 菜单上并放空间 vacated 由命令 文件 中。 版本2 各种悲剧之后终于解决了vc6.0 打开文件报错的问题 “0x5003eaed 的内存错误” 感慨收录下 从 Microsoft 下载中心下载下列文件有: FileTool.exe (http://download.microsoft.com/download/vc60ent/s1/6.0/w9xnt4/en-us/filetool.exe) 自解压 FileTool.exe 文件包含下列文件: 收起该表格展开该表格Commands.cpp 5KB Commands.h 1 KB DSAddIn.cpp 5KB DSAddIn.h 2KB FileTool.cpp 5K FileTool.def 1 KB FileTool.dsp 5KB FileTool.dsw 1 KB FileTool.h 1 KB FileTool.odl 2KB FileTool.rc 5KB FileTool_i.c 2KB FileToolTypes.h 7KB resource.h 1 KB StdAfx.cpp 1 KB StdAfx.h 3KB FileTool.rc2 1 KB TBarLrge.bmp 2KB TBarMedm.bmp 1 KB 有关如何下载 Microsoft 支持文件单击下面的文章编号,以查看 Microsoft 知识库中的相应: 119591 (http://support.microsoft.com/kb/119591/EN-US/ ) 如何从联机服务获取 Microsoft 支持文件 Microsoft 扫描病毒此文件。 Microsoft 使用最新的病毒检测软件在发布该文件的日期中获得的。 该文件存储在安全性得到增强有助于防止任何未经授权的更改对文件的服务器上。 安装外接程序 运行 FileTool.exe 提取 Visual C++ 6.0 项目。 生成 Visual C++ 中 发布 或 调试 配置中的项目。 在 Visual C++,请从 工具 菜单中单击 自定义 。 在 自定义 对话框单击 加载宏和宏文件 选项卡。 单击 浏览 按钮,并找到生成 FileTool.dll 文件步骤 2。 单击 确定 保存设置。 出现一个对两个命令的工具栏。 注意: 仅在 打开 的命令 Visual C++5.0 中有效。 该 AddFile 方法是使用 Visual Studio 6.0 版本添加的。 删除快捷键 加载外接之后,您可以删除菜单项,停止 Visual C++ 通过执行以下步骤下将它们分配给两个加载项命令的快捷键: 从 Visual C++ 工具 菜单中,单击 自定义 。 在 自定义 对话框单击 键盘 选项卡。 从 类别 框选择 文件 。 在命令窗口中,选择 FileOpen 。 在 当前快捷键 窗口中选择该 Ctrl+O 条目,,然后单击 删除 。 从 类别 框选择 项目 。 在命令窗口中,选择 InsertFilesIntoProject 。 如果有与之关联的快捷方式请执行步骤 5,将其删除。 默认情况下没有为此项目的快捷方式项。 从 类别 框选择 加载宏 。 这两个加载项命令 AddFileToProject 和 OpenFile 出现在命令窗口中。 选择 OpenFile 然后将光标放在 按新快捷键 框,按快捷键或键组合要然后单击 分配 。 其他命令,请重复上面的步骤。 对两个命令分配的快捷键将出现在当前注册表项窗口中。 您可能还希望删除菜单命令并插入在的位置的 加载项 命令。 若要插入新的 加载项 命令在 MenuBar,使用以下步骤: 从 Visual C++ 工具 菜单中,单击 自定义 。 单击 文件 菜单,然后将 文件 弹出式菜单的 打开 命令拖放并将其释放。 单击 项目 菜单,单击 添加项目 ,然后将,弹出菜单的 文件 命令拖并释放它。 在 自定义 对话框选择该 命令 选项卡。 从 类别 列表框中选择 加载项 。 将 OpenFile 命令拖到 文件 菜单中拖出,vacated 由 打开 命令在空间中。 AddFileToProject 命令到 添加项目 项在 项目 菜单上拖它 vacated 文件 命令在空间中。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值