0

I'm trying to make a game using SFML. I did a part of it on Visual Studio 2012 and Windows 7. I tried to run the game on another PC that uses Windows XP, but I got an error "MSVCP110D.dll was not found". I saw another topic in this forum that says to compile the code in Release mode, but when I choose the "Release" option before compiling, Visual Studio underlines everything that is releted with SFML. It can't find the library that I have included "SFML/Graphics.hpp". In "Debug" mode everything is OK. Do you have any idea how I can run my game on different PC (Windows XP or Windows 7)?

I changed the properties of the project to compile for Windows XP. Without this option when I try to run the game on XP, in error occurs "Not a valid 32 bit application".

Everything is working now. I changed all setting for release mode. On my Win XP PC I installed C++ Redistribution 2012. But what if I send the game to person who don't have C++ Redistribution 2012?

user2972343
  • 21
  • 1
  • 7
  • If your project compiler in debug mode but not in release mode then it's because your project settings are incorrect for release mode. Whatever changes you made to project settings for debug mode you have to make the equivalent changes for release mode. For instance if in release mode it can't find "SFML/Graphics.hpp" that's because the release mode setting for 'additional include directories' is not correct. – john Nov 23 '13 at 07:28
  • To run your VC++ application on another computer you have to add corresponding Redistributable package (see http://msdn.microsoft.com/en-us/library/dd293575(v=vs.110).aspx)/ And read this "Redistributing Visual C++ Files" - http://msdn.microsoft.com/en-us/library/ms235299(v=vs.110).aspx – SChepurin Nov 23 '13 at 07:49
  • I changed all options for Release mode. I was thinking that I just need to change the option form "Debug" to "Release". But now when I try to run it on XP it says "MSVCP110.dll was not found" - without the 'D' in the end. It is in release mode. What can be the problem? – user2972343 Nov 23 '13 at 07:52
  • Redistributing Visual C++ on my XP PC is from 2010. Do I need the 2012 version because I'm writing the game on VS 2012? – user2972343 Nov 23 '13 at 07:56
  • Yes, you need corresponding .dlls. Thus, Redistributable for VC++2012. – SChepurin Nov 23 '13 at 07:58
  • It worked! I installed C++ Redistribution 2012 on my XP computer and everything is fine. But what if I send the game to person who don't have C++ Redistribution 2012? – user2972343 Nov 23 '13 at 07:58
  • 1
    You can statically link the run-time libraries needed for your app. This was answered already on SO/ See, for example - http://stackoverflow.com/questions/854653/how-do-i-create-a-win32-dll-without-msvcr90d-dll/855218#855218 – SChepurin Nov 23 '13 at 08:13

1 Answers1

1

As the discussion in the comments have shown, you should always build in Release mode for deployment. Further more when you link the runtime dynamically you need to either provide the DLLs with your application (copy them from the Visual Studio directory next to your executable) or ship/link the matching redistribution.

Another option would be to link statically as Schepurin pointed out, but keep in mind that this can cause other issues if not done right and consistently.

Lukas
  • 2,461
  • 2
  • 19
  • 32