为什么除非安装 Visual Studio 2008,否则我的程序无法运行?
我编写了一个使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您很可能正在链接 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.
您的意思是为什么 Microsoft Visual需要 C++ 2008 可再发行软件包 (x86)?
因为它们并不是默认安装在所有 Windows 上,尤其是 VS 2008 之前发布的 Windows。
即使
您需要一个库,在本例中为标准 C++ 库。
You mean why is Microsoft Visual C++ 2008 Redistributable Package (x86) needed?
Because they are not installed on all Windows by default, especially the ones that shipped before VS 2008.
Even for
You need a library, which in this case the Standard C++ library.
欢迎来到应用程序部署的奇妙世界。
运行该工具取决于您的可执行文件,它会告诉您哪些 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.
此程序可以帮助您查找计算机上丢失的 dll(如果有)运行
This program can help you find what dlls (if any) are missing on the the computer that it won't run on
默认情况下,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.
尝试在发布模式下编译,并确保所有必需的 DLL 都已安装在目标计算机上。 这个对我有用。
Try compiling in release mode, and make sure that all required DLLs are installed on the target machine. It works for me.
您对调试库有依赖吗?
Do you have dependencies on debug libraries?