Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 3(CHIANA CASE)


Section


Column
注意

Note:

此功能仅适用于
  • This feature is relevant only for VS 2008
及更低版本。

本节介绍如何使用 IncrediLink 选项来加速 Visual Studio .NET、2005 和 2008中的增量链接。

概述

IncrediLink 选项可以将增量链接从几分钟加速到几秒钟。 它通过组合 Visual Studio 的增量链接选项和修改 link.exe 命令行,以便在可行时将 LIB 文件的引用替换为构成该 LIB 文件的 OBJ 文件引用,从而完成此操作。 为了使增量链接功能在由 LIB 项目(这些项目链接到主项目中)组成的solutions中有效,后一种修改是必需的。

要打开 IncrediLink,在Agent设置的 Visual Studio 构建项下链接器页面选择“By default, enable IncrediLink”选项。

当此选项选中时,有两种模式可用:

  • 根据“Enable Incremental Linking”项目设置 - 在此模式下,IncrediLink 将仅对已启用“增量链接”的项目激活。 请注意,由于增量链接已默认启用,因此未专门禁用增量链接的所有项目都将包括在内。
  • 对于所有项目 - 在此模式下,IncrediLink 将对所有项目激活。
  • Do not create libraries”复选框控制 IncrediBuild 是否会为已被 IncrediLink 将其 OBJ 文件嵌入父项目的链接命令行的 LIB 项目跳过链接步骤。 由于这些 LIB 项目的 OBJ 文件已被链接到主可执行文件/DLL,因此您通常可以通过避免这些 LIB 项目的链接步骤来节省更多的构建时间。

对于 Visual Studio 2005/2008 构建,您可以在标准操作模式(“根据 IncrediBuild 默认设置”)和“根据‘使用库依赖项输入’项目选项”设置之间进行选择,后者将导致 IncrediLink 仅对于已在其项目属性设置中激活了此设置的项目而激活(“使用库依赖项输入”属性是 Visual Studio 2005/2008 相对于 IncrediLink 的等效设置)。

注意:

  • IncrediLink 仅影响 DLL 和 EXE 项目的链接。

注意事项

开启此功能需要考虑以下几点:

  • 如果不同的库项目重复定义相同的符号,则可能会显示“重复符号”链接错误消息。 这是因为相比于在不同目标文件中定义的重复符号,链接器更能容许存在于多个库中的重复符号。 如果发生这种情况,请更改代码以使每个符号仅容许一次定义。
  • 可能显示“缺少函数体”链接错误。 要解决此问题,请将函数体存根添加到代码中。
  • 代码中未引用的符号仍将包含在最终输出中(带有普通链接,将被忽略)。
Column
Visual Studio 参考
  • and earlier.

This section describes how to speed up incremental links in Visual Studio .NET, 2005, and 2008 using the IncrediLink option.


Overview

The IncrediLink option can speed up incremental links from several minutes to as little as a few seconds. It does this by combining Visual Studio's incremental linking option and modifying the link.exe command line, so that references to LIB files are replaced by references to the OBJ files, which make up that LIB file (wherever possible). The latter modification is required in order for the incremental linking feature to be effective in solutions consisting of LIB projects, which are linked into the main project(s).


To turn on IncrediLink, select the "By default, enable IncrediLink" option in the Agent Settings under Visual Studio Builds on the linker page.

Two modes are available when this option is active:

  • According to "Enable Incremental Linking" project setting – In this mode, IncrediLink is activated only for projects that have "Incremental Linking" turned on. Note that since Incremental Linking is enabled by default, this includes all projects that don't have Incremental Linking specifically disabled.
  • For all projects – In this mode, IncrediLink is activated for all projects.


  • The Do not create libraries checkbox controls whether IncrediBuild skips the link step of LIB projects whose OBJ files IncrediLink embeds into their parent project's link command line. As these LIB projects' OBJ files are linked into the main executable/DLL, it is often possible to save additional build time by avoiding these LIB projects' link step.

For Visual Studio 2005/2008 builds, a choice is given between the standard mode of operation ("According to IncrediBuild default setting") or the "According to 'use Library Dependency Inputs' project option" setting, which will cause IncrediLink to be activated only for projects which have this setting activated in the project's properties (the 'Use library Dependency Inputs' property is Visual Studio 2005/2008's equivalent setting to IncrediLink).

Note:

  • IncrediLink only affects linkage of DLL and EXE projects.

Considerations

There are a few things to consider with this feature turned on:


  • Duplicate Symbol link error messages may show up if different library projects define the same symbol twice. This is because the linker is more tolerant to duplicate symbols residing in libraries than it is to duplicate symbols defined in different object files. If this happens, change your code to include each symbol definition once.
  • Missing Function body link errors may show up. To work around this, add function body stubs to your code.
  • Symbols that are not referenced anywhere in the code are still included in the final output (with regular links, they are ignored).



Column

Visual Studio Reference:

Child pages (Children Display)
styleh4
pageVisual Studio Reference参考

IncrediBuild Solutions 简介:

Child pages (Children Display)
styleh4
pageIncrediBuild Solutions

用户手册User Manual:

Child pages (Children Display)
styleh4
pageIncrediBuild Windows User Manual用户手册