Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with Visual C++ program-- can't find the Debug CRT

I have a friend who's taking over a Visual C++ project from me and is having trouble running it. It's a graphics application and it uses the Qt GUI library. The reason I mention this is because of the error below.

He can build and link the program using Visual Studio 2010, but when he runs it this message comes up in the event viewer:

Activation context generation failed for "D:\Test\Qt\4.2.2\bin\QtGuid4.dll". Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b", type="win32", version="8.0.50608.0" could not be found. Please use sxstrace.exe for detailed diagnosis.

When we do as the message asks and run sxstrace.exe, here's what we see:

Begin Activation Context Generation. Input Parameter: Flags = 0 ProcessorArchitecture = Wow32 CultureFallBacks = en-US;en ManifestPath = D:\Test\Qt\4.2.2\bin\QtGuid4.dll AssemblyDirectory = D:\Test\Qt\4.2.2\bin\

--------------- INFO: Parsing Manifest File D:\Test\Qt\4.2.2\bin\QtGuid4.dll. INFO: Manifest Definition Identity is (null). INFO: Reference: Microsoft.VC80.DebugCRT,processorArchitecture="x86"type="win32",version="8.0.50608.0" INFO: Resolving reference Microsoft.VC80.DebugCRT,processorArchitecture="x86""win32",version="8.0.50608.0". INFO: Resolving reference for ProcessorArchitecture WOW64. INFO: Resolving reference for culture Neutral. INFO: Applying Binding Policy. INFO: No publisher policy found. INFO: No binding policy redirect found. INFO: Begin assembly probing. INFO: Did not find the assembly in WinSxS. INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC80.DebugCRT\8.0.50608.0__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL. INFO: Did not find manifest for culture Neutral. INFO: End assembly probing. INFO: Resolving reference for ProcessorArchitecture x86. INFO: Resolving reference for culture Neutral. INFO: Applying Binding Policy. INFO: No publisher policy found. INFO: No binding policy redirect found. INFO: Begin assembly probing. INFO: Did not find the assembly in WinSxS. INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC80.DebugCRT\8.0.50608.0__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL. INFO: Attempt to probe manifest at D:\Test\Qt\4.2.2\bin\Microsoft.VC80.DebugCRT.DLL. INFO: Attempt to probe manifest at D:\Test\Qt\4.2.2\bin\Microsoft.VC80.DebugCRT.MANIFEST. INFO: Attempt to probe manifest at D:\Test\Qt\4.2.2\bin\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.DLL. INFO: Attempt to probe manifest at D:\Test\Qt\4.2.2\bin\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.MANIFEST. INFO: Did not find manifest for culture Neutral. INFO: End assembly probing. ERROR: Cannot resolve reference Microsoft.VC80.DebugCRT,processorArchitecture="x86", publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50608.0".

Sorry for the length of that message, but I thought it might jog some memories. Is this a case of his not having the Visual C++ 2005 (I believe that's where the VC80 comes from) C runtime libraries installed? If so, can he download the VC++ redistribution package and install it, and will all be well then? Or is this a completely different problem?

like image 562
larryq Avatar asked Mar 02 '10 07:03

larryq


People also ask

What is CRT in C?

The C runtime Library (CRT) is the part of the C++ Standard Library that incorporates the ISO C standard library. The Visual C++ libraries that implement the CRT support native code development, and both mixed native and managed code. All versions of the CRT support multi-threaded development.

What are CRT functions?

Cardiac resynchronization therapy (CRT) is treatment to help your heart beat with the right rhythm. It uses a pacemaker to restore the normal timing pattern of the heartbeat. The CRT pacemaker coordinates how timing of the upper heart chambers (atria) and the lower heart chambers (ventricles).

What is debug heap?

The debug heap provides powerful tools to solve memory allocation problems of this kind. The Debug versions of the heap functions call the standard or base versions used in Release builds.


2 Answers

If your friend doesn't have VS2005 installed, he will not have the debug runtime libraries for it. They're not part of the redistributable runtimes and IIRC, Microsoft prohibits you from distributing them yourself so you have to have VS2005 installed in order to get them.

I would suggest that he'd rebuild the affected library if possible; I vaguely recollect that there are a couple of articles out on the web on how to rebuilding the GPL QT using Visual Studio, which I believe is not officially supported.

Mixing C++ runtimes requires a lot of care and you can fall into a fairly nasty trap if you don't get it exactly right. If rebuilding all libraries with VS2010 is not an option, your friend will have to get hold of VS2005. It might be worth checking if MS still offers the Express Edition of VS2005 for download.

like image 81
Timo Geusch Avatar answered Sep 29 '22 16:09

Timo Geusch


You might as well do below: LOL

If you are running your application on Windows 7 X64 mode which build in X64 target, you have to install the following X64 SP1 redistributable package

http://www.microsoft.com/download/en/details.aspx?id=2092

Note: The manifest file should change to processorArchitecture = X64 and type="win64"

If you are building your application with X86 (32 bit mode) which run on top of WOW64 layer you have to install X86 SP1 redistributable package

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5582

like image 28
mapple Avatar answered Sep 29 '22 14:09

mapple