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

来源:互联网 发布:软件平台性能指标 编辑:程序博客网 时间:2024/05/20 01:35

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


 

原创粉丝点击