Running .exe files on different computers.(visual studios) [duplicate] - c++

This question already has answers here:
How do I determine which c++ redistributables my program needs to run?
(4 answers)
Closed 5 years ago.
I am trying to run a .exe file which was made with visual studios on a different computer. The computer that i made the program on runs fine but if I run it on a different computers it will not run. I get these errors.
The code execution cannot proceed because ucrtbased.dll was not found.
Reinstalling may fix this problem.
and...
The code execution cannot proceed because VRUNTIME140D.dll was not found.
Reinstalling may fix this problem.
Please note I am using C++ to write the code. I downloaded the c++ Redistributable (visual studios 2017) and it still not working.
Thanks.

You need to install the Visual Studio runtime (redistributables) for the VS version used to build the application on the machine where you wish to run it.

Related

How to distribute a console application? [duplicate]

This question already has answers here:
Problems with running EXE file built with Visual Studio on another computer
(6 answers)
Closed 2 years ago.
I am new to C++ and recently made a Tic-Tac-Toe game, which is a console application (no graphics). I have built my project in Release mode in Visual Studio 2019. I want this application to be transferred from one computer to another. I have zipped the Release folder of Visual Studio and tried to transfer it into another PC. When I ran it on another PC it failed to work?
I am new to programming, please help.
You don’t mention the exact error, but a first order possibility is a missing dependency.
Odds are you are missing the Visual Studio C++ runtime on the target machine (the one you are coping to). Windows does not install them by default, but Visual Studio does install them.
To download the runtime, go to https://visualstudio.microsoft.com/downloads/ then navigate to “Other tools and frameworks” then “Microsoft Visual C++ Redistributable for Visual Studio“. Select the version that matches your build and download and install it. You can copy the runtime dlls over from your PC, but installing them is generally easier and better for maintenance. If you are using an older version of Visual Studio, the download is normally available, but you’ll have to search for it.
Failing that, you may have another dependency missing. You should look to tools such as Dependency Walker, still available here https://www.dependencywalker.com/.
It must be run on pc's which OS you built on if it doesn't have additional libraries (Not Standart). if you have additional libraries, Add .dll files into release folder.
If you need help on customizing Console, I'll glad to help you on this.

Visual c++ problem in compiling native windows 10 application [duplicate]

This question already has answers here:
MSVCP140D.dll missing, is there a way around? [closed]
(2 answers)
Closed 3 years ago.
I'm coding a native C++ application in Vs 2019 that sould be able to run on a freshly configured windows 10 machine.
The problem is that when i run my .exe app on this machine i get missing dlls error such as MSVCP140D.DLL, VCRUNTIME140D.dll etc.
I tried to install the vcredist from MSDN on the guest machine and i also tried changing the "runtime library" from the "code generation" module in the project config.
I also followed some other tutorials that i've read on this platform but i can't find nothing that really works.
I even tried to place the missing dlls in the same directory of the .exe file to register them manually, actually it does not work, but this app i'm developing should be redistributable so the user should have just to execute it.
If i try to compile my program with another compiler such as MinGw it works but i wanted to use the vc++ default compiler if possible.
Is there a way to solve this issue?
Thanks!
Maybe you used MSVCP140.DLL, wihtout the D. the D stands for DEBUG and I don't know if the Debug version version comes with the visual studio redistributable. If you compile in visual studio try to build the Release version, this should work with the DLL´s from the redistributable

The code execution cannot proceed because MSVCP100D.dll was not found [duplicate]

This question already has answers here:
MFC100d.dll Issue in VS2010
(2 answers)
Missing appcrt140d.dll while trying to run cocos2dx Debug.win32. Where to get the dll?
(2 answers)
Closed 3 years ago.
I was given an application called "program" by my teacher at my university. I can open the program at my university computer but somehow, i can't open it in my laptop. I try to look up some the solution like installing Microsoft Visual C++ Redistributable for Visual Studio 2017 but still the program can't run.
Thanks for your time
Just tell him to give you the "release version" of the program.
Or you can download and install "visual studio 2010 express" for trial version to open the program.

Visual Studio. Empty command prompt window when trying to run a program [duplicate]

This question already has an answer here:
Running my C++ code gives me a blank console
(1 answer)
Closed 7 years ago.
Please be forgiving, I'm new to programing. Recently Visual Studio stopped working properly. I tried my classic way of fixing things, which is reinstalling, but apparently VS remembers all settings. Trying to run any program results in something like this, an empty command prompt. Has anyone encountered a similar problem, or knows how to completely remove all VS settings? I believe the problem is with my PC because when I work from e.g. school library everything is working fine.
You may easily reset all Visual Studio settings in Tools -> Import and Export settings.
Another option is to create an experimental instance (new "profile") of Visual Studio with CreateExpInstance utility.

Error involving dll when running C++ executable on another computer [duplicate]

This question already has answers here:
Visual C++ executable and missing MSVCR100d.dll
(6 answers)
Closed 8 years ago.
I want to share a simple program I made in VS2010 using C++, but when running on another computer I get an error. Here is the error message:
The program can't start because MSVCR100D.dll is missing from your
computer. Try reinstalling the program to fix this problem.
I have the dll in the same folder, as I thought this would fix it. I'm using the debug executable, and the other computer doesn't have VS2010 installed which is what I think is causing the problem.
Anyone have any solutions?
Target machine needs to have Redistributable Package for Visual C++ 10.0 installed. Download it from here:
http://www.microsoft.com/en-us/download/details.aspx?id=5555
You may also consider reading this section of MSDN to learn more about deployment process:
http://msdn.microsoft.com/en-us/library/zebw5zk9(VS.100).aspx
EDIT:
It seems that I missed that small 'd' in the DLL name. While this solution would be helpful in case of MSVCR100.dll (release version), it won't help you with the debug version, which you linked you application against. That's because debug DLLs are not included in redist packages - they are only shipped with Visual Studio.
Required DLLs (release builds) are placed in (VSInstallDir)\VC\redist(Platform)\Microsoft.VC100.CRT
Their debug versions can be found in (VSInstallDir)\VC\redist\Debug_NonRedist(Platform)\Microsoft.VC100.Debug.CRT.
However, I don't think that making any effort to run debug build is a good solution. Providing release build is probably what you should do.