API程序链接错误

来源:百度知道 编辑:UC知道 时间:2024/05/17 01:37:34
编译时给出如下错误:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Key.exe : fatal error LNK1120: 1 unresolved externals
我的main函数如下:
int APIENTRY WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // pointer to command line
int nCmdShow // show state of window
)
{
MSG msg;

if(!InitApplication(hInstance))
return(FALSE);
if(!InitInstance(hInstance,nCmdShow))
return(FALSE);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}

return(msg.wParam);
}
请各位高人点拨。
一楼的回答好高深啊!小弟看得不是很懂,请解释!
对不起,我用的是中文版的,所以没看懂,好象工程菜单里没有您说的选项啊。

这是WIN32程序,不要用控制台去编译,新建一个WIN32项目,在把代码加进去.

project =>property =>linker => system =>subsystem,
修改为:
Windows (/SUBSYSTEM:WINDOWS)
==========================
晕,都是菜单操作顺序。