본문 바로가기

IT/C++, MFC

(Visual Studio 2008, MFC) MSVCR90.dll 시스템 오류

시스템 오류 발생

  • 에러 메세지

MSVCR90.dll이(가) 없어 코드 실행을 진행할 수 없습니다. 프로그램을 다시 설치하면 이 문제가 해결될 수 있습니다.

 

  • 출력 보기 선택: 디버그

'test.exe': 'P:\3. 프로그램\workspace\test0_2022-11-24\x64\Debug\test.exe' 로드, 기호가 로드되었습니다.
'test.exe': 'C:\Windows\System32\ntdll.dll' 로드
'test.exe': 'C:\Windows\System32\kernel32.dll' 로드
'test.exe': 'C:\Windows\System32\KernelBase.dll' 로드
'test.exe': 'C:\Windows\WinSxS\amd64_microsoft.vc90.debugmfc_1fc8b3b9a1e18e3b_9.0.30729.1_none_785235bc18e43c18\mfc90d.dll' 로드, 기호가 로드되었습니다.
'test.exe': 'C:\Windows\WinSxS\amd64_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_737233ca1c100ce5\msvcr90d.dll' 로드
'test.exe': 'C:\Windows\System32\user32.dll' 로드
'test.exe': 'C:\Windows\System32\win32u.dll' 로드
'test.exe': 'C:\Windows\System32\gdi32.dll' 로드
'test.exe': 'C:\Windows\System32\gdi32.dll' 언로드
'test.exe': 'C:\Windows\System32\gdi32.dll' 로드
'test.exe': 'C:\Windows\System32\gdi32full.dll' 로드
'test.exe': 'C:\Windows\System32\shlwapi.dll' 로드
'test.exe': 'C:\Windows\System32\msvcrt.dll' 로드
'test.exe': 'C:\Windows\System32\msvcp_win.dll' 로드
'test.exe': 'C:\Windows\System32\ucrtbase.dll' 로드
'test.exe': 'C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.1110_none_792d1c772443f647\comctl32.dll' 로드
'test.exe': 'C:\Windows\System32\msimg32.dll' 로드
'test.exe': 'C:\Windows\System32\shell32.dll' 로드
'test.exe': 'C:\Windows\System32\advapi32.dll' 로드
'test.exe': 'C:\Windows\System32\oleaut32.dll' 로드
'test.exe': 'C:\Windows\System32\sechost.dll' 로드
'test.exe': 'C:\Windows\System32\rpcrt4.dll' 로드
'test.exe': 'C:\Windows\System32\combase.dll' 로드
'test.exe': 'C:\Windows\WinSxS\amd64_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_737233ca1c100ce5\msvcp90d.dll' 로드

 

  • 에러 원인

Visual Studio 2008에서 Visual C++ 6로 만든 예제를 실행하던 중 위와 같은 에러 메세지가 발생했다. (2022-11-22)

프로젝트 속성 - 구성 속성 - C/C++ - 코드 생성 - 런타임 라이브러리 - 다중 스레드 DLL (/MD)로 설정 되어 있었다.

 

(참고1) 나무위키 'Visual Studio'

C/C++ Runtime DLL인 MSVCR90.DLL, MSVCP90.DLL에 Side by Side 기술이 도입되었다. 덕분에 보안이 매우 향상되었지만, 이전처럼 개발한 EXE 파일에 DLL만 함께 복사하면 실행이 되지 않는다. VC++ Runtime 패키지를 따로 설치해 주거나, 개발한 프로그램의 설치본(msi)를 만들 때 병합 모듈로 추가시켜 주어야 한다. 웃긴 것은 VS 2008에 기본으로 포함된 설치 프로젝트 설정에서는 병합 모듈을 추가할 수 없다. 대신 MS에서 공식으로 밀어주는 WiX(Windows Installer XML)를 사용해 보도록 하자.


 

(참고2) 프로젝트 속성 런타임 라이브러리 설정

  1. 다중 스레드 (/MT): _MT 정의. 다중 스레드 정적 버전. 링커가 LIBCMT.lib를 사용해 외부 기호를 확인. 컴파일러가 라이브러리 이름인 LIBCMT.lib를 .obj 파일에 추가
  2. 다중 스레드 디버그 (/MTd): _DEBUG_MT 정의. 컴파일러가 .obj 파일에 라이브러리 이름 LIBCMTD.lib를 배치하여 링커가 LIBCMTD.lib를 사용하여 외부 기호를 확인.
  3. 다중 스레드 DLL (/MD): 런타임 라이브러리의 다중 스레드별 및 DLL별 버전을 사용. _MT_DLL 정의. 컴파일러가 라이브러리 이름 MSVCRT.lib를 .obj 파일에 배치. 컴파일한 애플리케이션은 MSVCRT.lib에 정적으로 연결
  4. 다중 스레드 디버그 DLL (/MDd): _DEBUG, _MT_DLL 정의. 런타임 라이브러리의 디버그 다중 스레드 DLL별 버전을 사용. 컴파일러가 라이브러리 이름 MSVCRTD.lib를 .obj 파일에 배치.


 

참고

 

참고1: https://namu.wiki/w/Visual%20Studio#s-4.6

참고2: https://learn.microsoft.com/ko-kr/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-170