C++ 遇到error LNK2019: unresolved external symbol "public: void __thisca的问题

1>main.obj : error LNK2028: unresolved token (0A00032D) "public: void __thiscall ImageVolume::readVolume(unsigned char *,char const *,long)" (?readVolume@ImageVolume@@$$FQAEXPAEPBDJ@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImageVolume::readVolume(unsigned char *,char const *,long)" (?readVolume@ImageVolume@@$$FQAEXPAEPBDJ@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)

 

解决方案:在方法的。cpp里面加上  ImageVolume:: getlength()

void ImageVolume::readVolume(u_char * buf,char const *filename,int length)
{
	FILE *file=fopen(filename,"rb");
	//u_char * buf;
	if(file==NULL)
	{
		printf("open the file failed!");
	}
	fread(buf,sizeof(unsigned char),length,file);
	fclose(file);
	printf("read is ok");
}


 

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页