Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't my program run unless Visual Studio 2008 is installed?

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?

like image 817
Brock Woolf Avatar asked Nov 28 '22 05:11

Brock Woolf


2 Answers

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.

like image 56
NeARAZ Avatar answered Dec 16 '22 02:12

NeARAZ


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.

like image 39
Eugene Yokota Avatar answered Dec 16 '22 02:12

Eugene Yokota