| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 503 人关注过本帖
标题:[求助]帮忙看看这个程序
只看楼主 加入收藏
kcsjyyy
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-5-31
收藏
 问题点数:0 回复次数:6 
[求助]帮忙看看这个程序

//clock
#include<iostream.h>
class Time
{public:
Time()
{hour=0;
minute=0;
second=0;
}
void set_time();
void show_time();
private:
int hour;
int minute;
int second;
};
void Time::set_time ()
{cin>>hour;
cin>>minute;
cin>>second;
}
void Time::show_time ()
{cout<<hour<<":"<<minute<<":"<<second<<endl;
}

int main()
{
Time t1;
t1.set_time();
t1.show_time();
Time t2;
t2.show_time();
return 0;
}
帮忙看看这个程序怎么老是出现error LNK2001: unresolved external symbol _WinMain@16错误




搜索更多相关主题的帖子: private include public minute second 
2007-03-09 14:50
半支烟
Rank: 1
等 级:新手上路
帖 子:83
专家分:0
注 册:2007-1-16
收藏
得分:0 

会吗 ??


2007-03-09 17:30
cctv2cctv
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2006-9-4
收藏
得分:0 
#include<iostream.h>
改成#include<iostream>
#include<windows>
或改成#include<iostream.h>
#include<windows.h>
或main改成Main试试
2007-03-09 18:35
boyyang4894
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2007-2-13
收藏
得分:0 
我用GCC运行成功.头文件改为:
#include<iostream>
using namespace std;
2007-03-10 22:57
yuyunliuhen
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:1435
专家分:0
注 册:2005-12-12
收藏
得分:0 
以下是引用kcsjyyy在2007-3-9 14:50:14的发言:

//clock
#include<iostream.h>
class Time
{public:
Time()
{hour=0;
minute=0;
second=0;
}
void set_time();
void show_time();
private:
int hour;
int minute;
int second;
};
void Time::set_time ()
{cin>>hour;
cin>>minute;
cin>>second;
}
void Time::show_time ()
{cout<<hour<<":"<<minute<<":"<<second<<endl;
}

int main()
{
Time t1;
t1.set_time();
t1.show_time();
Time t2;
t2.show_time();
return 0;
}
帮忙看看这个程序怎么老是出现error LNK2001: unresolved external symbol _WinMain@16错误




程序没错误吧..


Go confidently in the  directions of your dreams,live the life you have imagined!Just do it!
It is no use learning without thinking!
2007-03-11 00:38
琥珀之风
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2005-11-3
收藏
得分:0 
是不是建工程的时候建错了。。?应该建win32 console Application
错误说找不到winmain的连接,win application的程序入口点才是winmain

还有可能是编译器对代码要求的程序入口点必须是 int main(int argc,char*[] argv)...

恶魔只是将人类引入堕落的深渊 天使吹响了末日审判的号角 ——恶魔的追随者
2007-03-11 10:22
lehmann
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-8-15
收藏
得分:0 
在win32 console Application
运行正常
2007-03-11 18:45
快速回复:[求助]帮忙看看这个程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011946 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved