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");
}