gpt4 book ai didi

windows - 在 Windows : SxS, list 和所有爵士乐上构建和部署 dll

转载 作者:可可西里 更新时间:2023-11-01 14:41:07 26 4
gpt4 key购买 nike

从 VS 2005 开始,我发现不可能简单地针对 MS 运行时构建一个 dll 并将它们一起部署 (http://www.ddj.com/windows/184406482)。我对 manifest、SxS 和 co 深感困惑:MSDN 文档真的很差,循环引用;特别是因为我更喜欢 Unix,所以我发现所有这些都没有提供信息。我的核心问题是将 dll 链接到 msvc9 或 msvc8:由于这些运行时不可再分发,链接和部署此类 dll 的步骤是什么?特别是, list 是如何生成的(我不想要 mt.exe,我想要跨编译器可移植的东西),它们是如何嵌入和使用的?并排组装是什么意思?

基本上,我在哪里可以找到任何类型的规范而不是 MS 行话?

谢谢大家的回答,这真的很有帮助,

最佳答案

我们在所有应用程序和 DLL 中使用一个简单的包含文件 vcmanifest.h,然后将所有项目设置为嵌入 list 文件。

vcmanifest.h

/*----------------------------------------------------------------------------*/

#if _MSC_VER >= 1400

/*----------------------------------------------------------------------------*/

#pragma message ( "Setting up manifest..." )

/*----------------------------------------------------------------------------*/

#ifndef _CRT_ASSEMBLY_VERSION
#include <crtassem.h>
#endif

/*----------------------------------------------------------------------------*/

#ifdef WIN64
#pragma message ( "processorArchitecture=amd64" )
#define MF_PROCESSORARCHITECTURE "amd64"
#else
#pragma message ( "processorArchitecture=x86" )
#define MF_PROCESSORARCHITECTURE "x86"
#endif

/*----------------------------------------------------------------------------*/

#pragma message ( "Microsoft.Windows.Common-Controls=6.0.0.0")
#pragma comment ( linker,"/manifestdependency:\"type='win32' " \
"name='Microsoft.Windows.Common-Controls' " \
"version='6.0.0.0' " \
"processorArchitecture='" MF_PROCESSORARCHITECTURE "' " \
"publicKeyToken='6595b64144ccf1df'\"" )

/*----------------------------------------------------------------------------*/

#ifdef _DEBUG
#pragma message ( __LIBRARIES_ASSEMBLY_NAME_PREFIX ".DebugCRT=" _CRT_ASSEMBLY_VERSION )
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".DebugCRT' " \
"version='" _CRT_ASSEMBLY_VERSION "' " \
"processorArchitecture='" MF_PROCESSORARCHITECTURE "' " \
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
#else
#pragma message ( __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT=" _CRT_ASSEMBLY_VERSION )
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \
"version='" _CRT_ASSEMBLY_VERSION "' " \
"processorArchitecture='" MF_PROCESSORARCHITECTURE "' " \
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
#endif

/*----------------------------------------------------------------------------*/

#ifdef _MFC_ASSEMBLY_VERSION
#ifdef _DEBUG
#pragma message ( __LIBRARIES_ASSEMBLY_NAME_PREFIX ".MFC=" _CRT_ASSEMBLY_VERSION )
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".MFC' " \
"version='" _MFC_ASSEMBLY_VERSION "' " \
"processorArchitecture='" MF_PROCESSORARCHITECTURE "' " \
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
#else
#pragma message ( __LIBRARIES_ASSEMBLY_NAME_PREFIX ".MFC=" _CRT_ASSEMBLY_VERSION )
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".MFC' " \
"version='" _MFC_ASSEMBLY_VERSION "' " \
"processorArchitecture='" MF_PROCESSORARCHITECTURE "' " \
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
#endif
#endif /* _MFC_ASSEMBLY_VERSION */

/*----------------------------------------------------------------------------*/

#endif /* _MSC_VER */

/*----------------------------------------------------------------------------*/

关于windows - 在 Windows : SxS, list 和所有爵士乐上构建和部署 dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/110249/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com