首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VC >

VC LNK2019异常

2012-04-03 
VC LNK2019错误烦劳各位帮忙看一下C/C++ code#include iostream#include fstream#include cstdlib#i

VC LNK2019错误
烦劳各位帮忙看一下

C/C++ code
#include <iostream>#include <fstream>#include <cstdlib>#include <Windows.h>using namespace std;class MyFile{    protected:        char* _data;        int _length;    public:        MyFile();        MyFile(char *a)           {        }};class RLE:public MyFile{    public:        RLE(MyFile a)        {        }        RLE() : MyFile() {};};int main(int argc, char* argv[]){    MyFile File1("1");    RLE rle(File1);    system("pause");    return 0;}


错误:
error LNK2019: 无法解析的外部符号 "public: __thiscall MyFile::MyFile(void)" (??0MyFile@@QAE@XZ),该符号在函数 "public: __thiscall RLE::RLE(class MyFile)" (??0RLE@@QAE@VMyFile@@@Z) 中被引用d:\my documents\visual studio 2010\Projects\RLETest\RLETest\main.objRLETest

初学C++,谢谢各位了!



[解决办法]
class MyFile
{
protected:
char* _data;
int _length;
public:
MyFile(){}//这里有大括号
MyFile(char *a)
{
}
};

热点排行