游戏开发论坛

 找回密码
 立即注册
搜索
查看: 3489|回复: 1

大哥大姐们帮我看看这小程序行不

[复制链接]

6

主题

24

帖子

26

积分

注册会员

Rank: 2

积分
26
发表于 2005-11-8 22:42:00 | 显示全部楼层 |阅读模式
这是我第一次编win32程序,可是就卡了,不知道是不是什么东西没装还是什么其他原因
原程序:
// DEMO2_2.CPP - a simple message box
#define WIN32_LEAN_AND_MEAN

#include <windows.h>        // the main windows headers
#include <windowsx.h>       // a lot of cool macros

// main entry point for all windows programs
int WINAPI WinMain(HINSTANCE hinstance,
                               HINSTANCE hprevinstance,
                               LPSTR lpcmdline,
                               int ncmdshow)
{
// call message box api with NULL for parent window handle
MessageBox(NULL, "THERE CAN BE ONLY ONE!!!",
                 "MY FIRST WINDOWS PROGRAM",
                  MB_OK | MB_ICONEXCLAMATION);

// exit program
return(0);

} // end WinMain

编译后的提示:
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp1.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.

Cpp1.exe - 1 error(s), 0 warning(s)

为什么呀,帮帮我呀,

0

主题

1

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2005-11-9 00:17:00 | 显示全部楼层

Re: 大哥大姐们帮我看看这小程序行不

把代码中的

#define WIN32_LEAN_AND_MEAN



#include <windowsx.h>       // a lot of cool macros

两行注释掉试一下.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-2-5 23:51

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表