문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

이것은 "사전 빌드 이벤트"와 아무 관련이 없습니다. 컴파일하는 동안 컴파일러에서 컴파일러가 적용하지 않을 수도 있고 적용되지 않는 최적화입니다.

.NET Framework를 타겟팅 할 때 최적화 복잡성의 추가 레이어를 추가합니다. 가능한 한 많은 최적화가 C # 컴파일러가 처음에 코드를 IL을 컴파일 할 때 코드가 실행되기 직전에 JIT 컴파일러가 JIT 컴파일러에서 수행하지 않고 (IL이 기본 코드로 컴파일 될 때)

and yes, JIT 컴파일러는 가능한 언제든지 함수 호출을 취소하는 것과 같이 이러한 사소한 최적화를 적용합니다. 이것은 모든 최적화 도구를위한 낮은 매달려있는 과일입니다. (불명예 기능이 느려지는 )을 만들 수있는 조건은 일반적으로 이것을 인식하기에 충분히 똑똑해지는 조건이 일반적으로 똑똑합니다. 당신은 이 의미가 있다고 생각합니다. 보통 당신보다 똑똑합니다.)

사용자의 초점은 명확하고 읽고 읽기가 쉽지 않은 코드에 있어야합니다. 프로파일 링 된 후에는 그것이 너무 느리고 결정한 후에 그것을 최적화하는 방법에 대해 걱정하지 마십시오.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top