views:

196

answers:

4

Hello! I wrote a game in C++ + SFML using Visual Studio 2010 Express. I packed in all libraries like msvcr100.dll, opengl32.dll etc. but some pepole can run my game, and others can't :/ I don't know why, because I added everything that is necessary to run the game. People that can't run game get messages like : "The procedure entry point _ftol2 could not be located in the dynamic link library msvcrt.dll"

How can I make this game run on all machines?

+1  A: 

It seems that your friends don't have the same msvcrt.dll as you have. They should install the VC 2010 redistributable package which has all the libraries or you could link your game statically with the standard runtime libraries.

You can get the redistributable package here (x86 version)

Jaka
But I add these dlls to package
gamer43
You can link statically with the libraries as I said. This way the required functions will be linked inside the exe.
Jaka
+6  A: 

Please don't copy the DLLs. Use the Visual Studio 2010 Redistributable Package. If you want to make this simpler, use some tool which will allow you to make a setup project. Visual Studio Professional has a simple, easy-to-use setup wizard creator.

Dark Falcon
But, what can I do if my friend don't know computer very well, and don't want to install Visual Studio 2010 Redistributable Package, he only want to download package from me, and run the game.
gamer43
Then you should make a setup program for him. Microsoft provides a Windows Installer merge module for the VS2010 runtime which can be integrated into an MSI-based installer which also contains your game.
Dark Falcon
You could always link against the C++ library. Go to Project > Properties... > C/C++ > Code Generation and change the value of runtime library to "Multi-threaded (/MT)". That way there's no need to install any redistributables.
Note that static linking will make your program larger. Not that it isn't worth it, just keep this in mind.
Dark Falcon
/MT makes a lot of errors :/ I dont why, I try NODEFAULTLIB, but it is still dont work
gamer43
Static linking will make your application deployment _smaller_, if you currently have to distribute the runtime DLL. Static linking essentially copies only the needed functions to your .EXE. Hence, it usually adds less than sizeof(DLL) to your EXE.
MSalters
+1  A: 

Please edit your post to include the REAL error message - otherwise, people will start guessing games and won't be able to provide you with an answer as good as if you had included all the necessary information in your posting.

The error message probably is

"The procedure entry point _ftol2 could not be located in the dynamic link library msvcrt.dll"

...which most likely means you provided the wrong version of msvcrt.dll, and the people who can run your application have the right version installed by chance. In order to fix this, provide the correct version.

Jim Brissom
A: 

I find problem, I added my opengl32.dll to this package. I think opengl32.dll works different on some systems, so when I remove this library, everybody can run my program

gamer43