C++ LNK2019未解析的外部符号?

C++ LNK2019未解析的外部符号?,c++,C++,我有一个疑问,所以我在这里请求一些帮助。提前谢谢 我定义了一个实现文件系统基本功能的类,如下所示: //Header.h #include <iostream> using namespace std; typedef int BOOL; #define TRUE 1 #define FALSE 0 typedef struct NODE { struct NODE *prev; int data; struct NODE *next; }NODE,*PN

我有一个疑问,所以我在这里请求一些帮助。提前谢谢

我定义了一个实现文件系统基本功能的类,如下所示:

//Header.h
#include <iostream>
using namespace std;

typedef int BOOL;
#define TRUE 1
#define FALSE 0

typedef struct NODE
{
    struct NODE *prev;
    int data;
    struct NODE *next;
}NODE,*PNODE,**PPNODE;

class doubly_circular
{
   private:
           PNODE head;
           PNODE tail;

public:
       doubly_circular();
       ~doubly_circular();

       BOOL insertfirst(int);
       BOOL display();
       int count();
};
//main.cpp
int main()
{
doubly_circular obj1,obj2;

obj1.insertfirst(1);
obj1.insertfirst(101);
obj1.insertfirst(151);

obj1.display();

return 0;
}
doubly_circular::~doubly_circular()
{ 
    free(head);
    free(tail);
}   
它仍然给我这个错误

Error   1   error LNK2019: unresolved external symbol "public: __thiscall doubly_circular::~doubly_circular(void)" (??1doubly_circular@@QAE@XZ) referenced in function _main    I:\doublycircularLL\doublycircularLL\main.obj   doublycircularLL

虽然我把所有的函数都分离出来了,但链接器还是给了我错误,如果有人注意到我做错了什么,请告诉我。另外,如果有人需要更多信息,请告诉我。非常感谢您

首先-声明析构函数

doubly_circular::~doubly_circular()
{ //destruction code here }
然后-修复此问题:

PNODE newN=NULL; // this is incorrect, as you will not be able to assign data to a node
PNODE newN=new NODE; // construct new node
newN->prev=NULL;
newN->data=ino;
newN->next=NULL;

最后,使用std::list作为容器,而不是发明新的容器。如果你需要循环结构——使用“< /p>”,你知道C++有一个内置类型<代码> BoOL < /C> >吗?你在哪里实现了<代码> DouByyLyByth[/CudioSturtor?]为了解决你的错误,你声明了一个析构函数,用于<代码> DouByyLyCult但从未定义它。错误消息很清楚:你声明了类的析构函数,但你没能定义它。有什么不清楚的吗?很抱歉这个双循环::~double_循环(){//destruction code here}我实际上实现了析构函数,但它没有被复制,真的很抱歉。
PNODE newN=NULL; // this is incorrect, as you will not be able to assign data to a node
PNODE newN=new NODE; // construct new node
newN->prev=NULL;
newN->data=ino;
newN->next=NULL;