Redistributing an Application and Binding It to Specific Libraries

本文涉及的产品
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
云数据库 Tair(兼容Redis),内存型 2GB
简介:

Visual Studio 2008

Updated: July 2008

The libraries for Visual Studio often are updated after a release. For example, this can occur when you install a service pack. Applications that are designed with the updated libraries might depend on some changes that were made in the latest releases. The application might behave in unexpected ways if you transfer it to a user who has not installed the same libraries. To protect against this unexpected behavior, you can bind your application to a specific version of the libraries.

Default Binding Behavior


This section describes the default behavior of applications compiled with Visual C++ 2008 and later releases. When you compile an application, it is bound to the original release version of libraries available. This is true even if you have a later release installed on your computer. For example, if you have Visual C++ 2008 SP1 installed on your computer, any applications that you compile on this computer will still depend on the original release version of Visual C++ 2008.

This behavior is of no consequence if you deploy your application by installing in a central location. By using this distribution scheme, the latest libraries will always be available to the end user. However, if you use a local deployment method, such as with private assemblies as described in the topic How to: Deploy using XCopy, this behavior is important.

The default binding behavior enables you to recompile your program after you obtain a new release, and to distribute the new executable. The end users who already installed the necessary libraries will need only the new executable; you will not have to package and reinstall the latest libraries.

NoteNote:

If your application depends on functionality introduced in the latest release, you must distribute and reinstall the new libraries, or else the application will not run.

How to Bind to Specific Versions


If you want to force your application to require that the latest libraries be installed on your computer, use one or more of the following lines of code:

Copy

#define _BIND_TO_CURRENT_CRT_VERSION 1
#define _BIND_TO_CURRENT_ATL_VERSION 1
#define _BIND_TO_CURRENT_MFC_VERSION 1
#define _BIND_TO_CURRENT_OPENMP_VERSION 1

Use the following line of code to bind your application to the current version of all your Visual C++ libraries. This is a union of all the previous lines of code.

Copy

#define _BIND_TO_CURRENT_VCLIBS_VERSION 1;

NoteNote:

We recommend that you define these macros at the command-line level. If you prefer to include the definitions in code, you must put them at the very start of every compilation unit - such as the first lines in stdafx.h.

When you bind your application to a set of libraries, it will not run on a computer that has an earlier version of those libraries. If you bind your application to a specific minimum version, we recommend that you ship your application together with the required version of the libraries.

See Also


Concepts

Redistributing Visual C++ Files


本文转自海天一鸥博客园博客,原文链接:http://www.cnblogs.com/sgsoft/archive/2010/09/19/1831306.html,如需转载请自行联系原作者

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
Ninja is required to load C++ extensions | 问题解决
Ninja is required to load C++ extensions | 问题解决
|
6月前
|
Java
You may wish to exclude one of them to ensure predictable runtime behavior
You may wish to exclude one of them to ensure predictable runtime behavior
55 1
|
7月前
target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target S
target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target S
107 0
|
编译器
[√]添加预处理的2个不同方式:target_compile_definitions / add_definitions
[√]添加预处理的2个不同方式:target_compile_definitions / add_definitions
272 0
|
Java 数据库连接 mybatis
URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)
URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)
URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)
|
Devops 容器
Why SSDs Matter for Application Development
Solid state disks (SSDs) have become popular in today's servers and consumer devices as a means of improving data I/O and application performance
1217 0
Why SSDs Matter for Application Development
|
Android开发 数据格式 XML
Architecture -- Data Binding Library
1). 简介 Data Binding Library是一个支持库,允许在布局文件中绑定数据源。最小支持API为14,gradle插件最小为1.5.0。示例 2).
900 0