본문 바로가기

프로그래밍

[MFC]error LNK2001: unresolved external symbol _WinMain@16 해결 방법



error LNK2001: unresolved external symbol _WinMain@16

--------------------------------------------------------------------------------
발생하는 현상:
Microsoft Visual C++ generates the link error:

msvcrt.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16

or

msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16


원인:
The linker is looking for the entry point for a console application, but the application is being compiled and linked as a windows application (i.e. not a console application).

This error has been observed after changing the project settings from using MBCS to UNICODE characters.


MFC 유니코드인 경우에는 엔트리 포인트 이름이 wWinMainCRTStartup로 바뀌었기 때문에
Project Setting에 입력해줘야 함


해결 방법:
Under the project settings, under the ‘Link’ tab, category ‘output’, set the ‘Entry-point symbol’ to ‘wWinMainCRTStartup’.


UNICODE로 바꾼 경우에는


Project Setting(Alt+F7)에서 Link 탭으로 간 다음에, output 카테고리를 선택한 다음에~


Entry-point symbol 에다가 wWinMainCRTStartup 를 입력해주면 끝