exe generated with Visual Studio creates dll errors on other pc's - c++

I wrote a programm with Visual Studio, that i wanted to share with some friends. But when taking the complete folder containing the debug folder containing my .exe file and sending it to friends it throws 3 errors:
missing vcruntime140.dll
missing MSVCP140D.dll
missing urctbased.dll
(the order is probably not correct)
We tried to reinstall/update Microsoft Visual C++ Redistributable 2017 x64 on this page, but without any positive results.
Might this be a problem, that I'm using the SDL2 library? I copied the SDL2.lib into their Syswow64 folder and system32 folder, which removed that specific .dll error, but made the others first appear.

Choosing Realese option before building project and then sending the whole Release folder to your friends should solve this problem.

Related

MyProject.dll is not a valid win32 application

I have copied a C++ solution folder written with visual studio 2013 to my Pc and tried to run it (I mean VS Debugging) with VS 2022. the solution Contains 5 projects but I just target one of them so unloaded the rest and set the one as Startup project and this error happened.
Error Image
Solution file is working well on first pc and project is not a win32 project its x64 (I don't know much from win32 or x64).
Unable to start program. [VALUE].dll is not a valid Win32 application error in Visual Studio 2017
According to this question I tried selecting project, setting as startup, repairing VS, installing vcredist_x64 but non helped.
After Running, VS make Debug folder in solution Directory not the project "LP_Dll\x64\Debug" (LP_Dll is the solution name) without any .exe file, and the error path is exactly this folder, can it be from that?
Project properties the "Configuration Type" was mistakenly changed to .dll.

Visual Studio c++ dll not found

I am trying to link my .exe file to a .dll in visual studio but I don't understand how (I am using VS2019).
I have looked at this question here but it only provides half the solution. I went to project properties->debugging->Environment and added PATH=LOCATION_OF_MY_DLL and this works when I run the program in the IDE, but when I manually run the .exe it gives the same error that the dll was not found (it is only fixed if I copy the dll to the exe location).
In addition, I am managing the entire project using premake so is there a way to add these setting in there as well?

Missing .dll in different Visual Studio versions

I recently came up with an issue. I had a project created on visual studio 2015, using allegro5 library which executed on Debug and Release mode correctly.
When I changed visual studio versions though and started using 2019 version (In the mean time I had to format my PC and re-installed only VS19) and loaded the project, the execution had a missing msvc110d.dll error shown up.
I tried to find a way in order for my project to be "upgraded" and instead of looking into the old version of msvc to try and look up the newer version, but couldn't find anything.
So is there a way for me to change some settings in order for my project to expect newer versions of msvc, or do I have to create a new project and copy paste all the configurations and files/assets inside that new project?
Thank you all
P.S I know that the error can be resolved If I get the .dll file inside that directory, but that is bad practice for sure. Also could you give me a tip on how to setup a project correctly in order to prevent those kind of issues in the future?
I think you need to find the VS2015 redistributable on Google and install it on your machine. That should solve it.
Windows dynamic library files are installed under c:\windows\system32 directory. A 32 bit dll file in a 64 bit windows can be found under c:\windows\syswow64. When your VC++ developed application searches for the dll it first checks in the application folder and then the system folder. If it is not found in these locations, a "missing dll file" error will be shown.
Normally, installing the right VC++ redistributable does the trick. But at times the mismatch persist as the sdk you're using is not in conformity with the system dll. You shouldn't replace the existing dll in the system directory manually with a downloaded( download only from www.microsoft.com) one as other installed software may also failed in the process.
In such worse case scenario, you can however directly copy the downloaded dll files in your application folder itself and distribute along your software so that it runs on a remote host too. Normally these compatible dll files, for both debug and release versions, are also available in your VC++ sdk directory which can be copied for a perfect match.

msvcr120d Is missing

I've been trying to compile on opencv program in C++ and I have randomly started getting this error message.
Using dependency walker I can see that this dll is needed by my program but is net being found.
I used Xsearch to search my computer for the dll but it is not found.
I have downloaded a copies of the dlls (both the release and debgu versions) and placed them in the same directory as my application.
I have also tried placing them in the C:\windows\System32 folder and using regsvr32 to register them.
Regsvr32 gives me another error message
I've also tried installing the redistributable packages for visual studio with no effect.
I seem to be running out of options :(
Doh
Figured it out
Was using msvcr120 instead of msvcp120

My Qt5 executable does not run outside of Visual Studio 2010

I have done a big project with Qt5 and visual Studio 2010. Everything is well inside of visual studio using the run button.
But my goal is of course to release it to other persons, without visual studio.
My problem is: I can't get the .exe run outside of visual studio. I was asked for several dll's at first, I found them all in the Qt5 bin folder.
But know I got rid of those messages, when I wan't to open my exe, nothing happens.
Just nothing.....
I cannot even find my exe in the windows task manager.
Does someone here know an answer to that issue?
There are dll files that are loaded during runtime and don't give you any error, warning or whatsoever when not present (also totally transparent to dependency walker). Such is the platforms\qwindows.dll - note that it must be in a platforms\ subfolder relative to the executable. You might also be missing libEGL.dll and libGLESv2.dll.
Dependency Walker is not very useful in this case as it shows very strange dll files missing: API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL etc.
You can use Qt5.x cmd prompt ( 5.x is the version that you are using) and run windeployqt.exe from your build directory. It will automatically find and copy all necessary dll files to your output directory.