[vc]MFC使用unicode環境時compile問題

有關於C/C++的語法, 程式等
回覆文章
頭像
tim
文章: 1380
註冊時間: 2008年 11月 26日, 00:49

[vc]MFC使用unicode環境時compile問題

文章 tim »

Error LNK2001: '_WinMain@16': Unresolved External Symbol

請參考,
kb: http://support.microsoft.com/kb/125750/EN-US/
http://www.cryer.co.uk/brian/mswinswdev ... 1ueswm.htm

Symptom:
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

Cause:
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.

Remedy:
Under the project settings, under the ‘Link’ tab, category ‘output’, set the ‘Entry-point symbol’ to ‘wWinMainCRTStartup’.
多多留言, 整理文章, 把經驗累積下來.....
回覆文章