ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • (임시) 의존성 문제였나!? 그 결과와 얻은 내용 정리.
    프로그래밍 2012. 3. 21. 14:09
    재배포 패키지 버전 문제 발생시

    - '응용 프로그램 구성이 올바르지 않기 때문에 이 응용 프로그램을 시작하지 못했습니다. 이 문제를 해결하려면 응용 프로그램을 다시 설치하십시오.'

    위와 같은 에러와 함께 실행이 되지 않습니다.

    - 기타 에러 혹은 Microsoft Virtual PC등에서 바로 죽어 버리는 문제 혹은 잘못된 주소를 참조 했다거나... 예외가 발생했다는 에러는 프로그램의 오류
    가능성이 높다. 이때에는 release 빌드에 *.pdb 파일을 같은 폴더에 넣고 디버그 해보면 어느 함수에서 죽었는지 알 수 있다.
    ( 비주얼 스튜디오가 깔려 있다면... 없는 경우에는 콜스텍을 덤프해주도록 처리하면 문제가 없겠다. )

    -----------------------------------------------------------------------------------------------------------------------------------------------

    publicKeyToken="1fc8b3b9a1e18e3b" 의 의미는 어떤 버전(세부 업데이트까지가 아니고 그냥 대~~충 dx9 라고 부르는것 처럼.. 이해하믄 되겠다.)

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <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"></requestedExecutionLevel>
          </requestedPrivileges>
        </security>
      </trustInfo>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.6161" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
    </assembly>

    위의 manifest 는 정상이다.

    #define _BIND_TO_CURRENT_VCLIBS_VERSION 1

    을 wxWidgets-2.9.3 / squish-1.10 / 프로그램에 모두에 적용하고 플그램을 빌드해도 위와같이 나온다. (추측, 아마 다른 라이브러리나 dll 이

    9.0.21022.8 버전을 참조하고 있어서 그런듯하다.

    그리고 _BIND_TO_CURRENT_VCLIBS_VERSION 설정이 잘 적용되고 있는지 확인해 보고 싶다면.

    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include 혹은 vc2008 설치된 경로참조 crtassem.h 파일을 열어서

    참고해 보는게 좋겠다.

    #ifndef _CRT_ASSEMBLY_VERSION
    #if _BIND_TO_CURRENT_CRT_VERSION
    #define _CRT_ASSEMBLY_VERSION "9.0.30729.6161"
    #else
    #define _CRT_ASSEMBLY_VERSION "9.0.21022.8"
    #endif
    #endif

    참고로 나는 저렇게 되어 있었고 wxWidgets-2.9.3 / squish-1.10 / 프로그램에서 항상

    #define _CRT_ASSEMBLY_VERSION "9.0.30729.6161"

    가 추가되는것을 확인했음에도... 위에 나온 9.0.21022.8 버전에 대한 의존성을 가지고 있었다.

    -----------------------------------------------------------------------------------------------------------------------------------------------

    menifest 파일이 없을때(파일에 포함된경우 그리고 비주얼 스튜디오가 설치되어 있다면) mt.exe 파일로 생성해 볼 수 있다. (당연히 비주얼 스튜디오 프롬프트에서 실행)

    mt.exe -inputresource:test.exe -out:test.exe.menifest

    위와같이 하면 되겠다.

    -----------------------------------------------------------------------------------------------------------------------------------------------

    결론! : 내가 프로그램에 버그를 심었던 것!! 그로 인해 vcredist 를 오해하고.. 삽질을 열씸히 했던 것이었음.
        (멤버 변수는 항상 초기화 해야 한다는것을 알았지만 이번에 깜빡! 정말로 깜빡했다..--a)
    첨언! : Windows7 에서는 몇가지 예외들에 대해서 관대한 편이다. Windows Xp 에서만 실행이 안되고 초반부에 말한 예외 관련된 에러 메세지가 보인다면
    자신의 소스 코드부터 찬찬히 그리고 디버깅 해보는것이 순서이다.
Designed by Tistory.