为什么除非安装 Visual Studio 2008,否则我的程序无法运行?

发布于 2024-07-10 02:56:20 字数 106 浏览 8 评论 0原文

我编写了一个使用 GLUT、OpenGL 和 FMOD 的游戏。 问题是,除非计算机上安装了 Visual Studio 2008,否则二进制文件将无法运行。

为什么是这样?

I have written a game that uses GLUT, OpenGL and FMOD. The problem is that the binary won't run, unless Visual Studio 2008 is installed on the computer.

Why is this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

森林迷了鹿 2024-07-17 02:56:20

您很可能正在链接 C/C++ 运行时的 DLL 版本。 转到项目属性 -> C++-> 代码生成,并将运行时库设置为不是“DLL”类型之一。

或者,您可以链接到 DLL 运行时,但随后您必须使用应用程序重新分发运行时。

MSDN 提供了有关 C++ 应用程序部署各个方面的详细信息: http://msdn.microsoft .com/en-us/library/zebw5zk9.aspx

另外,Dependency Walker (depends.exe) 将显示您的可执行文件所依赖的库。 它也随 Visual Studio 的某些版本一起提供。

Most likely you're linking with DLL versions of the C/C++ runtime. Go to project properties -> C++ -> Code Generation, and set Runtime Library to not be one of "DLL" kinds.

Alternatively, you can link to DLL runtimes, but then you have to redistribute the runtime with your application.

MSDN has more information on various aspects of C++ application deployment: http://msdn.microsoft.com/en-us/library/zebw5zk9.aspx

Also, Dependency Walker (depends.exe) will show what libraries your executable depends on. It ships with some versions of Visual Studio as well.

转身泪倾城 2024-07-17 02:56:20

您的意思是为什么 Microsoft Visual需要 C++ 2008 可再发行软件包 (x86)

此软件包安装运行时
C 运行时 (CRT) 的组件,
标准 C++、ATL、MFC、OpenMP 和
MSDIA 库。 对于图书馆来说
支持并行部署模型
(CRT、SCL、ATL、MFC、OpenMP)它们是
安装到本机程序集中
缓存,也称为 WinSxS 文件夹,位于
Windows 操作系统的版本
支持并排装配。

因为它们并不是默认安装在所有 Windows 上,尤其是 VS 2008 之前发布的 Windows。

即使

cout << "Hello, World" << endl;

您需要一个库,在本例中为标准 C++ 库。

You mean why is Microsoft Visual C++ 2008 Redistributable Package (x86) needed?

This package installs runtime
components of C Runtime (CRT),
Standard C++, ATL, MFC, OpenMP and
MSDIA libraries. For libraries that
support side-by-side deployment model
(CRT, SCL, ATL, MFC, OpenMP) they are
installed into the native assembly
cache, also called WinSxS folder, on
versions of Windows operating system
that support side-by-side assemblies.

Because they are not installed on all Windows by default, especially the ones that shipped before VS 2008.

Even for

cout << "Hello, World" << endl;

You need a library, which in this case the Standard C++ library.

暮年 2024-07-17 02:56:20

欢迎来到应用程序部署的奇妙世界。

运行该工具取决于您的可执行文件,它会告诉您哪些 DLL 还需要与 EXE 一起复制。

Welcome to the wonderful world of application deployment.

Run the tool depends on your executable and it will tell you which DLLs you need to also copy along with your EXE.

倒数 2024-07-17 02:56:20

此程序可以帮助您查找计算机上丢失的 dll(如果有)运行

This program can help you find what dlls (if any) are missing on the the computer that it won't run on

梦屿孤独相伴 2024-07-17 02:56:20

默认情况下,Windows 仅安装 C 运行时和 C++ 标准库 dll 的发行版本。 安装 Visual Studio 将另外安装调试版本。

确保您正在部署的版本完全是在发布模式下构建的。

Only the release versions of the C runtime and the C++ standard library dlls are installed with Windows by default. Installing Visual Studio will additionally install the debug versions.

Make sure the version you're deploying is built entirely in release mode.

時窥 2024-07-17 02:56:20

尝试在发布模式下编译,并确保所有必需的 DLL 都已安装在目标计算机上。 这个对我有用。

Try compiling in release mode, and make sure that all required DLLs are installed on the target machine. It works for me.

゛清羽墨安 2024-07-17 02:56:20

您对调试库有依赖吗?

Do you have dependencies on debug libraries?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文