Visual Studio C++ 3rd Party dll's prevent .exe from running - c++

I am new to C++ an I am making an application in Visual Studio 2010 using an SDK which has 3rd party dll's. I want to be able to run this program on other computers so I looked at this question to make sure I include them right (specifically Laserallan's answer). I then build the program in release mode and it compiles fine. The problem is, when I try to run the .exe in the sample release folder the program doesn't run. Not sure if these detals are relevent but my project uses MFC in a static library and Multi-Threaded(MT) runtime library. Incremental linking is not enabled.
My suspicion is that it has something to do with the dll's being in the same place as the .exe because if I move one of them out of the sample release folder, I get this error:
I also noticed this in the SDK's API. I'm not sure if it is relevent or not:
"The eBUS SDK is provided as DLLs. Static libraries are not offered at this point. Even though DLLs are provided, it is still necessary to link your application against link libraries of the DLLs."
The .exe was working fine before, It only started mucking up when I tried to put the dll's in the same place as the exe, tried to make it work on other computers and when I reinstalled the SDK. Does anyone have any ideas on what it could be? It has been doing my head in for the past 2 days now. Any help would be greatly appreciated.

I solved it, turns out the new computer had 2 versions of PvBuffer, one had the GetAcquiredSize method and the other didn't. The program was executing the version that didn't and was trying to find a method that wasn't there. Thanks for your help!

Related

Debugging Qt in visual studio, msvcp140d_app.dll is missing

I'm new to Qt, but have been working with Visual studio for C/C++ development for a few years. Now I'm trying to build a GUI for my project. I installed Qt 5.11.0 and the Qt VS Tools on both my work computer and home PC. At work I can build and run my project with the VS debugger, however on my home system I can build but can't run either with VS debugger or simply launching the app. I tried in release and it runs fine.
The error I'm getting is :
The code execution cannot proceed because VCRUNTIME140D_APP.dll was not found.
I get 4 of these, the first two want VCRUNTIME, the second two want MSVCP140D_APP.dll.
Solutions I've tried so far :
Uninstalled Win SDK and reinstalled
Uninstalled VS2017 and SDK and reinstalled
Searched System32, SysWOW64 and VS install directories - found msvcp140d.dll and vcruntime140d.dll, but no _app.dlls
Does anyone know what these are included with and where to get them? I can't figure out why I have them on my work computer but not at home. I have the same VS updates, same Qt version, and SDK on both systems.
Using :
Visual Studio 2017 v15.7.1
Qt 5.11.0 - msvc2017_64
I suppose I can just copy the .dll's from my work pc and drop them in the appropriate locations on the other, but I'd like to know what they should have been installed with so I can have the same setup on both systems.
Edit:
I also tried changing the platform toolset to VS2015 with Qt versions msvc2015_64 and winrt_x64_msvc2015
I found this post concerning the same missing _app.dll files. There wasn't any answer there, which is why I tried reinstalling the SDK in the hope the missing files were included there.
Edit 2:
I just scanned my entire system at work and it turns out that I don't have the missing .dll there either. That tells me that there is a difference in the project properties or configuration between the two. I use git for source control, and I am currently the only contributor to this project. When I try to build and run just the example from the getting started guide I have the same problem at home with missing _app.dll files, however it works fine at work. I'm totally confused now, and any hints are greatly appreciated.
Solution:
After trying for a couple of hours making new solutions etc. I decided to delete the entire build folder and put fresh copies of all the dependencies into it. My project now runs fine in debugging mode.
I'm fairly certain that when I originally copied the Qt .dll files into it I must have grabbed them from one of the winrt folders rather than the msvc2017_64 folder. To test I replaced the working .dll files with those from the winrt_x64_msvc2017 folder and sure enough the same errors again. So, this was a dumb mistake on my part, but hopefully it'll save someone else a lot of hair-pulling in the future.

When I execute an .exe (compiled on my machine) on another computer it give me this error

It's my first time using Visual Studio 2017. I built a simple program in C++ on my PC. I was curious to see if my program works on another PC. I tried to execute the .exe on the other computer and it gave me this kind of error:
vs(some letters and numbers).dll is missing.
I assume that the .dll in question is part of Visual Studio.
I tried on a third PC, and this time the cmd stops working and becomes unresponsive after I execute my .exe.
I also have this problem when I compile with MinGW using the g++ compile feature in the cmd. When I execute the program compiled with MinGW on another PC, it gives me the same error, but this time it says something like
gw...dll is missing
Is there a way to avoid this error without installing the Visual Studio (or MinGW at this point) on any other PC I want my program to run on?
If you're interested in the code, I can put it here, but I don't think it's the problem here because I have the same issue for every other .exe compiled on my PC.
Here's a picture of the error:
In case of Visual Studio, you need to install Visual C++ Redistributable libraries or provide the libraries that are required by your application with .exe file (I am not sure if it violates license or not though).
In case of MinGW, you need to provide required DLL as well. I guess that you need libgcc_s_dw2-1.dll and libstdc++-6.dll, but you would better check it yourself. And remember about the license.
You may use Dependency Walker to analyse dependencies of your application.
UPDATE (2017-12-12):
I've missed the time you posted the screenshot. As far as I see from it the problem is that you are trying to run debug version of your executable: ucrtbased.dll is the debug version of the ucrtbase library and is only available (from what I know) from Visual Studio distribution. If you want to run your application on the computers that do not have installed Visual Studio, then you should use the Release version of your application.
In order to understand your problem you need to understand the concept of DLL.
Dynamic-link library(DLL) - As described by Microsoft:
A DLL is a library that contains code and data that can be used by
more than one program at the same time. For example, in Windows
operating systems, the Comdlg32 DLL performs common dialog box related
functions. Therefore, each program can use the functionality that is
contained in this DLL to implement an Open dialog box. This helps
promote code reuse and efficient memory usage.
So to put it simply, DLL is basically a bunch of compiled code, which is being linked to your code at load (or even run-time). Now, of course if your system is missing the DLL, your progrem will fail to work. To make things even worse, DLL are sensitive to the compiler that was used. So each DLL might have multiple version, so you will need to right DLL.
Now to the problem itself, the error message are the best way to start. They guide you what DLL are missing, and what is their name. For instance in your case "vs*.dll" is most likely related to Visual C++ runtime redistributable.
Finally, please note you have another consideration to make in addition to make your own system work: Every one that will use your code might face the exact same problem. So if you actually intend to share your .EXE with other people, you will need to understand how to guide them, or even automate their installation process.

Visual Studio C++ "api-ms-win-crt-runtime-l1-1-0.dll missing", disreagrding \MT & Static MFC linking

I've been desperatly trying to get my School Project to run on those crappy school pcs, but i am not able to resolve the issue of missing Dll's.
My Project is set to "\MT" as Runtime Library and I've set MFC to static linking.
At first the MSVCP140.dll was missing, so i copied it in the folder with the .exe, but I'm not able to do that with before mentioned DLL.
Unfortunately, I can't install any runtimes or redists on the school pcs. (They run windows 7 with the latest updates)
EDIT:
I've did exactly what is recommended in all stackexachange answers, and it still doesn't work, so no, this is no duplicate.
Any help is appreciated! (it's my first stackoverflow question ^^)

Visual C Run-time libraries missing

I've been losing sleep over this for a few days now:
I'm using SFML to create an application and everything was well until I created a new project a few days ago. After that whenever I tried to compile a solution that uses SFML libraries I would get linker errors and missing DLL files.
I looked around and found a program called dependency walker which looks at which DLL files a program depends on. Apparently my program executable was missing some DLL files that are meant to be inside the windows directory.
I freaked out just a little, before finding out they all had the prefix "CRT" and the suffix of either nothing or "D" which meant that they were Visual C run-time library DLL's.
Even though I'm not missing vital DLL's from my PC, I still need to fix this issue. No there was not major hardware/software changes to my PC prior to the problem (I don't have an antivirus and just trust my guts, I haven't had an issue for 5 years now) and yes I'm sure I'm setting up the SFML directories properly following a tutorial.
I've tried reinstalling and repairing VS and the redistributable VC's for my version of VS (which is 2012 express for win desktop), tried clean booting, the windows self file check (sfc /scannow) and also tried manually placing DLL's into my directory that the dependency walker said I was missing.
Has anyone else encountered this before? How did you solve it?
*Interesting note: I have access to an admin account on my school network and installed VS on a computer there to see if the problem would re-occur. Since the windows directories on those machines are never modified VS executed fine. Could it be that I need to get a clean installation of windows?
I'm not sure if OP is allowed to answer on his own thread (or if there is a time limit), but here goes:
I solved my issue after looking at it with a cool head. I re-checked the version of my SFML libraries and wasn't sure if they were 64 or 32 bit, so I re-downloaded the 32-bit version (because my debug compiler is set to run on 32-bit) that was compatible with my version of VS. This changed the error I got from missing MSVCP140D.dll to MSVCO120D.dll (the numbers correspond according to the architecture).
I Googled/asked around for a while more to figure out that I needed a file named MSVCR120D.dll, which was found in system32 but not in SysWoW64. After placing respective architecture DLL files (64 bit for system32, 32 bit for SysWow64) it finally worked!
Even though dependency walker still says the executable is missing 6-7 other DLL files, the project still compiles and runs fine.
I hope this wasn't a solution that only applied to me, I've seen many others with the same problem.

Qt5Cored.dll missing when trying to run application

I'm using Visual Studio 2013 Ultimate.
My Qt version is 5.2.1
Am using a specific build for VS2013 which I obtained from here.
Now, what I did:
Created a new Qt Application from Visual Studio.
Typed in my logic and the code.
Built it successfully in x64 Debug mode.
Ran the application successfully.
Everything good so far.
Now the problem:
I restart my Visual Studio and load the project.
It is built successfully (in x64 Debug).
Now, am unable to run it. I get the error:
The program can't start because Qt5Cored.dll is missing from your computer.
Try reinstalling the program to fix this problem.
It ran the first time when I created the application. Now it won't run.
I tried simulating the problem, and this happens everytime. Runs the first time, and doesn't run after Visual Studio restart.
Please help me resolve this issue.
Thanks in advance.
From project properties you have to go to debugging -> Environment -> and write PATH=qt5 dll paths Or you have to put the dlls next to the exe.
The first time you in debug mode. Probably in that case Qt5Cored.dll (with a d in the name) was used. Maybe in the second build, you build in release mode, and for some reason Qt5Core.dll is not found in the PATH.
here is what i did and it worked :D
first : make sure you are building a release version not a debug version
second : it asked for the qt5core.dll when you copy it to the same path of your program it may ask for other *.dll files so i put the program in the folder containing all the dlls :D
which is
C:\Qt\Qt5.7.0\5.7\mingw53_32\bin
or according to your installation ..it worked well
any way this folder (as i think) contains all DLL libraries you may need with your program
so to know what exactly you need from it try to start your program many times in another location and in every time you will know another dll needed according to your programming ..
that method worked but i think there may be a more cleaver solutions we have to dig for :)