C++ 程序仅在安装 Visual Studio 后才能在 XP SP2 上运行 [英] C++ program works on XP SP2 only after installing Visual Studio

查看:31
本文介绍了C++ 程序仅在安装 Visual Studio 后才能在 XP SP2 上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 C++ 程序.这很简单 - 显示图像(启动画面)并启动另一个应用程序,然后在启动另一个应用程序时关闭.实际上,这个:http://www.olsonsoft.com/blogs/stefanolson/post/A-better-WPF-splash-screen.aspx 有非常小的变化(我的启动画面图像和我的程序被启动,而不是示例).

I have a C++ program. It's quite simple - shows an image (splash screen) and launches another application, then closes when that other application is started. Actually, this one: http://www.olsonsoft.com/blogs/stefanolson/post/A-better-WPF-splash-screen.aspx with very minor changes (my splash screen image and my program is launched instead of the sample one).

它在我的 Windows 7 开发机器上运行良好.它也适用于安装了 Windows XP SP2 和 Visual Studio 2008 的另一台(虚拟)机器.但它不能在没有 Visual Studio 的同一台虚拟 Windows XP SP2 机器上工作.它显示错误:在动态链接库 msvcrt.dll 中找不到入口点 memmove_s".

It works good on my Windows 7 developer machine. Also it works on another (virtual) machine with Windows XP SP2 and Visual Studio 2008 installed. But it doesn't work on just the same virtual Windows XP SP2 machine without Visual Studio. It shows an error: "Entry point memmove_s could not be located in the dynamic link library msvcrt.dll".

我发现一个可能的问题是在 WindowsCodec DLL 中(在 clear XP SP2 安装中没有这样的 DLL,但它在使用 Visual Studio 的 XP SP2 的 Windows/system32 文件夹中)所以我将它复制到 clear 上的应用程序文件夹中系统.之后程序部分运行(启动后启动另一个应用程序)但没有显示启动画面图像.

I have found that a problem possible is in WindowsCodec DLL (no such DLL in clear XP SP2 installation, but it is in Windows/system32 folder of XP SP2 with Visual Studio) so I copied it to the application folder on the clear system. After that the program partially works (launches another application after start) but didn't show the splash screen image.

安装 Microsoft Visual C++ Redistributable Package(2008 和 2010)没有帮助.

Installation of Microsoft Visual C++ Redistributable Package (both 2008 and 2010) didn't help.

我发现建议在 Visual Studio 中使用静态链接(多线程 (/MT) 项目属性中的选项 -> C/C++ -> 代码生成),但它也没有'帮助.

I've found a recommendation to use static linking in Visual Studio (Multi Threaded (/MT) option in project properties -> C/C++ -> Code Generation), but it also didn't help.

我也尝试过 DependencyWalker,但找不到两个测试系统在依赖项上的任何差异.

Also I have tried DependencyWalker but cannot find any differences in dependencies for both test systems.

有人知道为什么会发生这种情况吗?我是 C++ 的新手,希望这是我不知道的显而易见的事情...

Anyone have any ideas why this could happen? I'm completely new in C++, hope this is something obvious that I just don't know...

推荐答案

您的程序依赖于 .NET 框架,至少是 3.0 版.默认情况下,这在 XP SP2 安装中不可用.如果您没有看到 windowscodecs.dll,那么您没有安装正确版本的 .NET.这在您安装 VS2008 时确实有效,因为它还安装了 .NET.

Your program has a dependency on the .NET framework, at least version 3.0. That is not available on an XP SP2 install by default. If you don't see windowscodecs.dll then you didn't install the proper version of .NET. This does work when you install VS2008 because it also installs .NET.

下载在这里.

这篇关于C++ 程序仅在安装 Visual Studio 后才能在 XP SP2 上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆