C++类的构造函数,报错!该如何处理
C++类的构造函数,报错!
报错如下:
opengl error LNK2019: 无法解析的外部符号 "public: virtual __thiscall oImage::~oImage(void) " (??1oImage@@UAE@XZ) ,该符号在函数 "public: virtual void * __thiscall oImage::`scalar deleting destructor '(unsigned int) " (??_GoImage@@UAEPAXI@Z) 中被引用
代码如下:
class oImage
{
public:
oImage();
virtual ~oImage();
public:
GLuint texture[1];
AUX_RGBImageRec *LoadBMP(char * filename);
int LoadTextureImage();
bool LoadT8(char *filename, GLuint &texture);
void Inittexture(UINT textur);
};
平台:windowsXP,visual studio 2003 ,
触发条件:
public:
oImage();
virtual ~oImage();
将这三行删除,编译通过,加上后,编译失败
------解决方案--------------------
~oImage();
只有声明没有实现
------解决方案--------------------
换成:
oImage() {};
virtual ~oImage() {};
报错如下:
opengl error LNK2019: 无法解析的外部符号 "public: virtual __thiscall oImage::~oImage(void) " (??1oImage@@UAE@XZ) ,该符号在函数 "public: virtual void * __thiscall oImage::`scalar deleting destructor '(unsigned int) " (??_GoImage@@UAEPAXI@Z) 中被引用
代码如下:
class oImage
{
public:
oImage();
virtual ~oImage();
public:
GLuint texture[1];
AUX_RGBImageRec *LoadBMP(char * filename);
int LoadTextureImage();
bool LoadT8(char *filename, GLuint &texture);
void Inittexture(UINT textur);
};
平台:windowsXP,visual studio 2003 ,
触发条件:
public:
oImage();
virtual ~oImage();
将这三行删除,编译通过,加上后,编译失败
------解决方案--------------------
~oImage();
只有声明没有实现
------解决方案--------------------
换成:
oImage() {};
virtual ~oImage() {};