2010-03-14 2 views
0

XP에서 시작하지 않으려는 Windows 7 x64에서 VS2008 SP1a (9.0.30729.4148)로 응용 프로그램을 빌드했습니다.XP FlsAlloc을로드하려고하는 msvcr90.dll로 인해 배포 문제가 발생했습니다.

메시지는 The application failed to initialize properly (0x80000003). Click on OK to terminate the application.입니다. depends.exe으로 확인한 결과 msvcr90.dll은 KERNEL32.dll에서 FlsAlloc을로드하려고 시도하며 FlsAlloc은 Vista에서만 시작됩니다. 응용 프로그램에서 사용하지 않았을 것입니다.

어떻게 문제를 해결할 수 있습니까?

SXS 패키지가 이미 대상 시스템에 설치되어있는 - 사실 내가 3 개 9.0 SXS 버전 (초기 릴리스, SP1 및 SP1 + 보안 패치)

응용 프로그램 _BIND_TO_CURRENT_VCLIBS_VERSION=1

컴파일이 또한 나는 stdafx.h

#define WINVER 0x0500 
#define _WIN32_WINNT 0x0500 

매니페스트 파일에 올바른 대상 Windows 버전을 정의

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> 
<security> 
<requestedPrivileges> 
    <requestedExecutionLevel level="asInvoker" uiAccess="false" /> 
    </requestedPrivileges> 
    </security> 
    </trustInfo> 
<dependency> 
<dependentAssembly> 
    <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /> 
    </dependentAssembly> 
    </dependency> 
<dependency> 
<dependentAssembly> 
    <assemblyIdentity type="win32" name="Microsoft.VC90.MFC" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /> 
    </dependentAssembly> 
    </dependency> 
</assembly> 

결과에서

Started "c:\program files\app\app.EXE" (process 0xA0) at address 0x00400000. Successfully hooked module. Loaded "c:\windows\system32\NTDLL.DLL" at address 0x7C900000. Successfully hooked module. Loaded "c:\windows\system32\KERNEL32.DLL" at address 0x7C800000. Successfully hooked module. Loaded "c:\program files\app\MFC90.DLL" at address 0x785E0000. Successfully hooked module. Loaded "c:\program files\app\MSVCR90.DLL" at address 0x78520000. Successfully hooked module. Loaded "c:\windows\system32\USER32.DLL" at address 0x7E410000. Successfully hooked module. Loaded "c:\windows\system32\GDI32.DLL" at address 0x77F10000. Successfully hooked module. Loaded "c:\windows\system32\SHLWAPI.DLL" at address 0x77F60000. Successfully hooked module. Loaded "c:\windows\system32\ADVAPI32.DLL" at address 0x77DD0000. Successfully hooked module. Loaded "c:\windows\system32\RPCRT4.DLL" at address 0x77E70000. Successfully hooked module. Loaded "c:\windows\system32\SECUR32.DLL" at address 0x77FE0000. Successfully hooked module. Loaded "c:\windows\system32\MSVCRT.DLL" at address 0x77C10000. Successfully hooked module. Loaded "c:\windows\system32\COMCTL32.DLL" at address 0x5D090000. Successfully hooked module. Loaded "c:\windows\system32\MSIMG32.DLL" at address 0x76380000. Successfully hooked module. Loaded "c:\windows\system32\SHELL32.DLL" at address 0x7C9C0000. Successfully hooked module. Loaded "c:\windows\system32\OLEAUT32.DLL" at address 0x77120000. Successfully hooked module. Loaded "c:\windows\system32\OLE32.DLL" at address 0x774E0000. Successfully hooked module. Entrypoint reached. All implicit modules have been loaded. DllMain(0x78520000, DLL_PROCESS_ATTACH, 0x0012FD30) in "c:\program files\app\MSVCR90.DLL" called. GetProcAddress(0x7C800000 [c:\windows\system32\KERNEL32.DLL], "FlsAlloc") called from "c:\program files\app\MSVCR90.DLL" at address 0x78543ACC and returned NULL. Error: The specified procedure could not be found (127). GetProcAddress(0x7C800000 [c:\windows\system32\KERNEL32.DLL], "FlsGetValue") called from "c:\program files\app\MSVCR90.DLL" at address 0x78543AD9 and returned NULL. Error: The specified procedure could not be found (127). GetProcAddress(0x7C800000 [c:\windows\system32\KERNEL32.DLL], "FlsSetValue") called from "c:\program files\app\MSVCR90.DLL" at address 0x78543AE6 and returned NULL. Error: The specified procedure could not be found (127). GetProcAddress(0x7C800000 [c:\windows\system32\KERNEL32.DLL], "FlsFree") called from "c:\program files\app\MSVCR90.DLL" at address 0x78543AF3 and returned NULL. Error: The specified procedure could not be found (127).

내가 윈도우 SDK 7이 설치 및 기본 SDK로 구성되어 있음을 언급해야한다 따라 달라집니다.

+0

http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/21418b8b7fe-4049-b23a-f5e4941e63db/)는 Visual Basic에서 SDK 디렉토리가 맨 위에 있는지 확인해야한다고 말합니다. 사진관. 나는 그들을 바꿨지 만 성공하지 못했습니다. – sorin

답변

-1

매니페스트 도구는 실제로 버그가 있으며 유일하게 신뢰할 수있는 솔루션은 임베딩이 거의 무작위로 실패하기 때문에 매니페스트를 바이너리에 포함하지 않는 것입니다. 매니 페스트를 외부에 유지하는 것은 추악하지만 적어도 항상 작동합니다.

+0

또한 Microsoft는 VS 2010에서 매니페스트를 삭제했습니다. :) – sorin

0

저는 항상 내 DLL에 매니페스트를 포함 시키며 문제가 없었습니다. 내가 매니 페스트를 묻는 것을 잊었을 때 나는 단지 문제에 부딪쳤다. 그런 다음 Windows 2008에서 MSVCR90.dll을 찾지 못해도 이전 버전의 Windows에서 작동하므로 잠시 혼란스러워합니다.

관련 문제