| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 699 人关注过本帖
标题:编译通过,连接出错
只看楼主 加入收藏
karlzhouzhi
Rank: 1
等 级:新手上路
帖 子:70
专家分:0
注 册:2005-12-25
收藏
 问题点数:0 回复次数:3 
编译通过,连接出错

源代码:
class Date
{
public://公共界面

enum Month{jan=1,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec};
class Bad_date{};//异常类

Date(int dd=0,Month mm=Month(0),int yy=0);//0的意思是“取默认值”

//检查Date的函数
int day()const;
Month month()const;
int year()const;

string string_rep()const; //字符串表示
void char_rep(char s[])const;//C风格的字符串表示

static void set_default(int,Month,int);

//修改Date的函数
Date& add_year(int n); //加n年
Date& add_month(int n); //加n月
Date& add_day(int n); //加n天
private:
int d,m,y; //表示
static Date default_date;
};

Date Date::default_date(22,feb,1901);

void main()
{}

错误:ain.obj : error LNK2001: unresolved external symbol "public: __thiscall Date::Date(int,enum Date::Month,int)" (??0Date@@QAE@HW4Month@0@H@Z)
Debug/main.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

搜索更多相关主题的帖子: int 源代码 Month const Date 
2006-03-08 22:36
西部天狼
Rank: 1
等 级:新手上路
帖 子:95
专家分:0
注 册:2006-2-23
收藏
得分:0 
同问,请各位帮个忙啊

学习-->编程-->交流-->再学习-->再编程-->再交流
2006-03-09 22:37
olivezhang
Rank: 1
等 级:新手上路
帖 子:223
专家分:0
注 册:2005-9-14
收藏
得分:0 
Date(int dd=0,Month mm=Month(0),int yy=0); 没有实现。如这样改,通过:
Date(int dd=0,Month mm=Month(0),int yy=0) {}

谷底深深行 ,峰顶漫漫步......@_@
2006-03-10 09:29
sunnvya
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1094
专家分:0
注 册:2005-11-23
收藏
得分:0 
有点道理

http://www. 第二站>>>提供源码下载
2006-03-11 08:15
快速回复:编译通过,连接出错
数据加载中...
 
   



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

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