在类CPaper015Dlg头文件中定义
typedef struct individual
{
double fitness;
unsigned *chrom;
double varible[12]; //变量
int xsite; //位置
int parent[2]; //父个体
double Ts,Qp,Fz; //相关值
};
struct individual *oldpop;
void CacuVary(struct individual *);
结构体也定义了
源文件中 写 函数
void CPaper015Dlg::CacuVary(struct individual *critter)
{
}为了简便其中代码省略
当在其他函数中调用函数CacuVary(&oldpop[j]);
编译可以通过 但当在CLASS VIEW 中点击函数CacuVary(struct individual *critter)时却出现can't find the definition(implement)of this function
急!!请各位高手帮忙
typedef struct individual
{
double fitness;
unsigned *chrom;
double varible[12]; //变量
int xsite; //位置
int parent[2]; //父个体
double Ts,Qp,Fz; //相关值
};
struct individual *oldpop;
void CacuVary(struct individual *);
结构体也定义了
源文件中 写 函数
void CPaper015Dlg::CacuVary(struct individual *critter)
{
}为了简便其中代码省略
当在其他函数中调用函数CacuVary(&oldpop[j]);
编译可以通过 但当在CLASS VIEW 中点击函数CacuVary(struct individual *critter)时却出现can't find the definition(implement)of this function
急!!请各位高手帮忙
看你这行void CPaper015Dlg::CacuVary(struct individual *critter) ,这个函数是CPaper015Dlg的成员,你应该把定义放到类的public或者private或者protected下
...
}ABC;去掉typedef也是常规用法,肯定也没问题。