Why my Qt app request msvcp120d.dll on a computer but not mine - c++

I did an application with Qt5.5, wich use open cv.
It works, so now I want to deploy it on several computers.
On the first PC (PC1), it works too : I copied the dll of Qt and open cv and add the paths in the environment variables. I copied a folder with my application, some dll and datas (images).
On the second PC (PC2), I did the same, but I can't open the application. I have the error "msvcp120d.dll is missing..".
I compiled my app in release mode.
On my PC and PC1 I moved msvcp120d.dll on the desk, and the app don't request it.
Do you know why the app asks a debug dll?
I soon installed the redistribuables packages visual C++ (x64 and x86) on PC2, but it doesn't install msvcp120d.dll.
Do you have an other idea?
thanks'

It seems like some of the libraries that you are using is linking against a Debug CRT library (indicated by the trailing d in "msvcp120d.dll"). Those aren't redistributable, and are only available on systems, where Visual Studio is installed.
I would recommend to use dependency walker to find out which dlls/libraries that need the debug version and then recompile them as release configuration.

Related

What is needed to run a VS2019-compiled application on Windows Server 2012?

Recently I wrote a program with VS2019, invoking Tesseract OCR dll compiled in C++ (x64) and display result on a .NET Windows form. Everything works fine on my Windows 10 dev PC. When deployed to Windows Server 2012 (x64), it crashed, complaining that the C++ dlls are not found.
What I tried:
Install vc_redist.x64.exe from Microsoft, it's still not work. (Maybe not enough?)
Run a simple .NET windows form program on that server, and it works well. (It's not a .NET problem)
Update:
I used Dependency Walker that #Fenixil suggested, and the dlls below are not found:
API-MS-WIN-CORE-KERNEL-32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
MF.DLL
MFPLAT.DLL
MFREADWRITE.DLL
API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
EXT-MS-WIN-NTUSER-UICONTEXT-EXT-L1-1-0.DLL
IESHIMS.DLL
SETTINGSYNCPOLICY.DLL
WLANAPI.DLL
Those dlls can be found in my dev PC, in C:/Windows/WinSxS, multiple files in same name under different directory. Do they belong to some Windows SP update, or are they in the Win10 platform API? What's the best way to install them instead of simply copying them to production server?
There are multiple versions of vc_redist, you need to provide one that is used in your application. Here is some discussion with vc_redist not found, might be related to your issue.
You can use Dependency Walker tool to check which dlls are missing in the system

Application not working on Windows XP, despite using XP toolset. Troubleshoting ideas needed

I'm developing a dll library. My solution (cmake core, Visual Studio sln generated) consists of a few static .lib projects that are used to build this dll and the dll project itself. There are also some 3rd party dependencies (boost, nana and some more). I'm using hell dependencies manager (https://rilis.io/projects/hell) to download my dependencies. I know it's not widely used, but to put it short it is just a simple tool that after reading config file downloads dependencies using git, generates projects using cmake and compiles using the requested generator.
I need my dll to support Windows XP. I develop on Windows 10 machine and I copy the dll to Windows XP SP3 machine, which is where I run the tests. However my dll fails to load on windows xp. LoadLibrary returns nullptr. The name and architecture are matching. I'm not getting any system error, just the pointer returned is nullptr. I used to have system errors but I eliminated them by switching to functions that were present in Windows XP API. I enabled Snapping and ran profiling in DependencyWalker. I got errors about
api-ms-win-core-synch-*
api-ms-win-core-fibers-*
api-ms-win-core-localization-*
failing to load (probably also through dynamic loading during dll initialization. I found out its Windows XP compatibility issue. I figured out that I need to build my module using v140_xp toolset. Cmake provides options to specify toolset and hell is supposed to propagate this setting to build other dependencies using provided toolset. To the best of my knowledge about hell, cmake and visual studio that should be the case. However my dll still fails to load and DependencyWalker + snapping still show the same failed load attempts.
I want to know whether I missed something in my approach or if the toolset setting is not propagated to all static libraries. The second one could cause one or more of dependencies to be compiled with non xp toolset, resulting in linking with non-xp cruntime (I'm linking statically with crt - MTd/MT) and failed dependency.
I need some ideas that would help me troubleshot this issue. Anyone knows how I can check which obj or lib that my dll consists of could add dependency to non-xp API? Or maybe someone has an idea what I could have missed when building my module?
Thank you for your time!

What is gxres.rc?

I have a VC++ 6 application that is developed on old 32bit machines. The application is developed for 32bit machines, but can be run on 64bit machines - almost.
Some dialogs don't open.
Trying to debug - I have succesfully installed VC++ 6 onto a Windows 7 64bit machine. Upon compiling the project, the compiler says:
"fatal error RC1015: cannot open include file 'gxres.rc'."
What is gxres.rc?
Probably you don't installed all libraries that are used to build the project.
When I google for gxres.rc I find links on http://www.roguewave.com So you may have a library or parts of your code relay on other source code that isn't installed on the machine.
But you don't need to build on the target machine to debug the file. Just install VC6, place the source code and the exe with the PDB file on the machine an debug.
Also there may be still a chance to use the old remote debug features of VC6.
My last tipp: Don't use VC6 any longer... upgrade to a current version of VS!

How to create a release built of Win32 C++ app that uses lots of libs and not only included in VS environment headers?

So I created an app (with lots of help from SO and my friends). It compiles and runs on my machine (I tied to place it into different folders). VS created for me a debug older with my app : HelloVideoStreaming.exe some HelloVideoStreaming.ilk and HelloVideoStreaming.pdb. Problem is - when I try to run my app on another computer OS stups it from working saying that something about its parallel configuration is wrong.
I used Boost (used .lib libs), FFmpeg (Libs and DLLs ere linked into VS), OpenCV (I had it installed (installerfrom official open CV site) on my development computer) and OpenAL (I had it installed (installerfrom official open CV site) on my development computer).
Some of headers are included in VS some in project (via project properties)
How to make VS put all needed to deploy/run my app on other computers into one place? some folder like bin or somthing like that...
Do you mean "side-by-side" configuration is flagged as incorrect? You have to make sure that the runtime libraries you built with are available on the target machine, also any third-party DLLs that you need, though it sounds like you tried to use all static libraries there. For info on how to run VC++ apps from VS2010 on a machine that does not have VS 2010, see here - there are similar links for other compiler versions.
Please clarify the question if this is not the error you saw.

Program compiled with MSVC 9 won't start on a vanilla SP3 XP

I installed XP on a virtual machine, updated it to SP3 and then tested a small program compiled with Visual C++ 2008 on my real computer - however it didn't start but outputted only an error saying that a problem had been detected and that a reinstall of the application (mine is 10KB in size and doesn't even have an installation) could fix the problem.
What is required to run programs compiled with MSVC 9?
Can I just include some dlls for it to work everywhere?
Either link statially against the runtime library (select multithreaded instead of multithreaded-dll) or follow tommieb75's advice and install the MSVC9 runtime redistributable (copying to system32 or to the application's folder works as well, but is not the way to go, afaik). For small applications with no need for an installer, I'd prefer the first option. Deploying runtime installers is annoying.
You could be missing the MCVC9 runtime library, try copying that over to the Windows System32 folder...
It may depend against which DLLs your project is linked. Inspect the assemblies manifest and check if those DLLs are installed on your VM.
What does your program contains? Dependencies on dynamic C/C++ runtime? Then you need to either include the C++ redistributable runtime DLLs in your app, or change the program to use the static C++ runtime. Similarly, do you use ATL? MFC? Custom 3rd party libraries? They all add dependencies to your executable and Win32 will refuse to load your application.
One easy step is to check with Dependency Walker what dependencies your application has.
It could be a dll you application links against. The depends tool is a must have in every programmers toolbox for debugging dll dependency issues.
If you have the commercial rather than express msvc edition, what you really should do is copy the msvcmon redist components to your VM, run the remote debug monitor there, and attach to it from your desktop dev environment. This page explains the basic principal. Because it sounds like your app is causing an exception on XP.
If you can't remote debug and if dependency checker does not indicate a dll issue, then you could look in the systems application event log to see if there is any more information there. Or try install Dr Watson as a post mortem debugger. Open a command prompt and enter
drwtsn32 -i
to install Dr Watson as the post mortem debugger, and
drwtsn32
to get a config screen allowing you to browse for the location of crash dumps. You can load crash dump files directly with Dev Studio 2005 and later. (I don't think Dr Watson ships with Vista and Windows 7 anymore).