20分求解类成员无法找到的问题
我在tga文件的tga_writer类中加了一个函数声明getE(char *c, int x),并在tga.cpp文件中做了定义。
新建了一个MFC工程,一个button按下去的时候,调用getE函数,但是.net2003一直提示error C2039: “GetE” : 不是“tga_writer”的成员。而调用tga_writer中的其他原有函数的时候,系统不会提示错误,为什么?
[解决办法]
class tga_writer
{
FILE *Pfile;
int width, height;
public:
int GetE(char *filePath, int X, int Y, int compRatio);
};
void tga_writer::int GetE(char *filePath, int X, int Y, int compRatio){};
void main(){
tga_writer* tw = new tga_writer;
tw-> GetE();
delete tw;
}
[解决办法]
你没有实现
int GetE(char *filePath, int X, int Y, int compRatio);