본문 바로가기

3.구현/VC++

[Error]외부참조 LNK1120에러 중 GetRuntimeClass...

[Error]외부참조 LNK1120에러 중 GetRuntimeClass...

------ 빌드 시작: 프로젝트: xDownloader, 구성: Debug Win32 ------

컴파일하고 있습니다.

MainFrm.cpp  

링크하고 있습니다.

MainFrm.obj : error LNK2001: "public: virtual struct CRuntimeClass \* \_\_thiscall CMainFrame::GetRuntimeClass(void)const " ([?GetRuntimeClass@CMainFrame@@UBEPAUCRuntimeClass@@XZ](http://ospace.springnote.com/pages/mailto:?GetRuntimeClass@CMainFrame@@UBEPAUCRuntimeClass@@XZ)) 외부 기호를 확인할 수 없습니다.  
xDownloader.obj : error LNK2019: "public: static struct CRuntimeClass \* \_\_stdcall CMainFrame::GetThisClass(void)" ([?GetThisClass@CMainFrame@@SGPAUCRuntimeClass@@XZ](http://ospace.springnote.com/pages/mailto:?GetThisClass@CMainFrame@@SGPAUCRuntimeClass@@XZ)) 외부 기호("public: virtual int \_\_thiscall CxDownloaderApp::InitInstance(void)" ([?InitInstance@CxDownloaderApp@@UAEHXZ](http://ospace.springnote.com/pages/mailto:?InitInstance@CxDownloaderApp@@UAEHXZ)) 함수에서 참조)를 확인하지 못했습니다.  
Debug/xDownloader.exe : fatal error LNK1120: 2개의 확인할 수 없는 외부 참조입니다.

빌드 로그가 "file://c:\\MyProject\\xDownloader\\xDownloader\\Debug\\BuildLog.htm"에 저장되었습니다.  
xDownloader - 3 오류, 0 경고


\----------------------완료----------------------

    빌드: 성공 0, 실패 1, 생략 0  

위의 에러는 메임프레임 코드에서

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

이 주석 처리된 것이다.

즉, 위에서 유추할 수 있는 것이 GetRuntimeClass()관련한 에러는 몇몇 클래스 중에서 바로 인스탄스 안되고 RTTI형태로 작동이 되는 경우가 있다. 이때 RTTI에 의해서 미리 인스탄스 되어있지 않을 경우 에러가 발생하는 것이다.

출처 : 나의 머리속 메모리...

반응형