vs2008+sp1发布问题。

lood339 2011-01-13 11:11:08
我的应用程序生成的manifest文件的内容如下:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.30729.4148' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>



同时,VC90.CRT的版本是'9.0.30729.4148'。上面文件描述中还出现'9.0.21022.8'版本,不知道是什么意思。
按照
http://topic.csdn.net/u/20100406/21/33e6143f-202a-4ff8-8dc1-c5cc5ba7f519.html
方法无法解决。所以,我的问题是,我的应用程序需要那个版本的dll,这些dll这么和应用程序放在一起?
另外,安装vcredist_x86.exe (vs2008+sp1)方法无法解决。
静态编译也行不通(有编译错误)。
希望有实际经验的指点一把,谢谢。
...全文
350 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
lood339 2011-01-26
  • 打赏
  • 举报
回复
是在搞不定,我把vs2008装成不打补丁,问题暂时过去了。
但是在一些机器上会出现英文版本的机器上xp + sp3
the application failed to initialize oxc0150002的初始化错误。
在中文版中就没有这个错误,不知道这么解决。
lood339 2011-01-25
  • 打赏
  • 举报
回复
问题可能出现在我的manifest文件中。
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.30729.4148' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>

这么同时有'9.0.30729.4148' 和'9.0.21022.8'
两个版本好呢?
被这个问题缠了两周了。

[Quote=引用 6 楼 lood339 的回复:]
按照你说的,工程编译通过。但是,在其他及其上还是不能运行。

引用 4 楼 luciferisnotsatan 的回复:
/FI:预处理指定的头文件,与源文件中的#include有相同效果

在工程属性c/c++ => additional include directories 里加上 targetsxs.h 文件所在路径试试
[/Quote]
lood339 2011-01-14
  • 打赏
  • 举报
回复
按照你说的,工程编译通过。但是,在其他及其上还是不能运行。
[Quote=引用 4 楼 luciferisnotsatan 的回复:]
/FI:预处理指定的头文件,与源文件中的#include有相同效果

在工程属性c/c++ => additional include directories 里加上 targetsxs.h 文件所在路径试试
[/Quote]
  • 打赏
  • 举报
回复
找windows/winsxs/目录下对应版本的文件以及 .manifest 文件拷过去试试
luciferisnotsatan 2011-01-14
  • 打赏
  • 举报
回复
/FI:预处理指定的头文件,与源文件中的#include有相同效果

在工程属性c/c++ => additional include directories 里加上 targetsxs.h 文件所在路径试试
lood339 2011-01-14
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 luciferisnotsatan 的回复:]
以前也遇到过crt版本不对,找到一篇老外的文件,解决了。可惜没把文章保存下来

大致方法如下
建个targetsxs.h文件,加入下面的代码,然后在工程属性的c/c++ => command line里加上 /FI targetsxs.h 。就能指定使用哪个crt库了。


C/C++ code
#ifndef __midl
#define _SXS_ASSEMBLY_VERSIO……
[/Quote]
非常感谢你提供的方法,我按照提示做了。
但是,编译时出错Cannot open include file: 'targetsxs.h': No such file or directory。
我将targetsxs.h放在当前工程目录下,并包含再工程中了。
问:需要将targetsxs.h放在哪里才能被找到。另外能解释一下/FI,我对编译参数不太懂。谢谢
luciferisnotsatan 2011-01-14
  • 打赏
  • 举报
回复
以前也遇到过crt版本不对,找到一篇老外的文件,解决了。可惜没把文章保存下来

大致方法如下
建个targetsxs.h文件,加入下面的代码,然后在工程属性的c/c++ => command line里加上 /FI targetsxs.h 。就能指定使用哪个crt库了。

#ifndef __midl
#define _SXS_ASSEMBLY_VERSION "8.0.50727.762" //你要的crt版本
#define _CRT_ASSEMBLY_VERSION _SXS_ASSEMBLY_VERSION
#define _MFC_ASSEMBLY_VERSION _SXS_ASSEMBLY_VERSION
#define _ATL_ASSEMBLY_VERSION _SXS_ASSEMBLY_VERSION

#ifdef __cplusplus
extern "C" {
#endif
__declspec(selectany) int _forceCRTManifest;
__declspec(selectany) int _forceMFCManifest;
__declspec(selectany) int _forceAtlDllManifest;
__declspec(selectany) int _forceCRTManifestRTM;
__declspec(selectany) int _forceMFCManifestRTM;
__declspec(selectany) int _forceAtlDllManifestRTM;
#ifdef __cplusplus
}
#endif
#endif

lood339 2011-01-14
  • 打赏
  • 举报
回复
[Quote=引用楼主 lood339 的回复:]
我的应用程序生成的manifest文件的内容如下:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft……
[/Quote]

我的sp1显示的版本是9.0.30729.1 SP,但是,vc目录下redist\x86\Microsoft.VC90.CRT的版本是
9.0.30729.4148。有人知道这么回事吗?

24,860

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧