How to run win32 games on other pc?

I am creating a game playable on windows with cocos2d-x3.17.

In Visual Studio 2017, I set properties -> c / c ++ -> Code Generation-> Runtime Library to Multi-threaded DLL (/ MD) and built with Release configuration.
When I run the exe file on the pc I built it, I was able to play the game.

However, when I move Release.win32 folder to another pc and tried to execute it, I got errors that MSVCP140.dll and VCRUNTIME140.dll are missing, and I failed to execute.


Even after installing redist_x86 of VisualStudio2017 and restart pc, same errors occurred and execution failed.

When I build the game after setting the Runtime Library to Multi-threaded (/ MT), I get errors such as unresolved externals and the build fails.

How can I create a game that can be run on other pc?
Should I build with MD or MT?

Install Visual C++ Redistributable for Visual Studio 2015, which contains the required DLL files. It has nothing to do with the MT/MD switches.

2 Likes

Thank you for your reply.
Finally I installed all of VC++ redist. 2010, 2012, 2015, 2017.
However, I still get a message that VCRUNTIME140D.dll and ucrtbased.dll are missing and I cannot start the game.



I have built the game in Release Configuration, but why is this?

@noprops I remembered that someone else had a similar issue, and it turned out to be one of the libraries provided with cocos2d-x not having a release DLL. If you searched the forum for “VCRUNTIME14D.DLL” you would have seen the post.

The solution may be here: https://discuss.cocos2d-x.org/t/vcruntime140d-dll-not-found-for-windows-release/45836/11

1 Like

you need to download dll from the internet and copy .dll files to cocos win32 folder ! It’s easy !

That is never a good idea. Firstly, there’s the Microsoft licensing terms, and files like “VCRUNTIME14D.DLL” are debug binaries, which are not meant to be redistributed with any application. Secondly, you wouldn’t want to download them from just anywhere on “the internet”, because you won’t know if they have been compromised in some way, so you would be putting users of your application at risk. If you really must use the debug version of the DLLs, then copy them from your own PC, since they should be there if you have the relevant version of Visual Studio installed.

Alternatively, you could just do what makes more sense, and that is to address the actual cause of the problem, rather than trying to apply a band-aid solution to it. I guess the same advice applies to everything in life, so why not do it here too.

1 Like

For me ,Here is the simple solution ! You only need to copy .dll files to cocos folder ! And run .exe on other devices !
https://www.dll-files.com/msvcp140.dll.html
https://www.dll-files.com/vcruntime140.dll.html

If this is not a good solution , you can find another solution !

Thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.