vc2008编译不能通过 求高手解决
源程序
#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("HelloMsg"), 0);
return 0 ;
}
------ 已启动生成: 项目: HelloMsg, 配置: Debug Win32 ------
1>正在链接...
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用
1>E:\workspace\vc++2010\HelloMsg\Debug\HelloMsg.exe : fatal error LNK1120: 1 个无法解析的外部命令
1>生成日志保存在“file://e:\workspace\vc++2010\HelloMsg\HelloMsg\Debug\BuildLog.htm”
1>HelloMsg - 2 个错误,0 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
用code::blocks可以编译并运行
[解决办法]
::MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("HelloMsg"), 0);
[解决办法]
_main 工程:subsystem:console
WinMain 工程:subsystem:windows
改设置。