error LNK2019: 无法解析的外部符号

2019-07-14 12:49发布

OsProcessDlg.obj : error LNK2019: 无法解析的外部符号 "public: struct pcb * __thiscall CLinkQueue::InitialPcb(class ATL::CStringT > >,int,int)" (?InitialPcb@CLinkQueue@@QAEPAUpcb@@V?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@HH@Z),该符号在函数 "public: void __thiscall COsProcessDlg::OnBnClickedButton1(void)" (?OnBnClickedButton1@COsProcessDlg@@QAEXXZ) 中被引用
1>C:/Users/liuan/Documents/Visual Studio 2008/Projects/OsProcess/Debug/OsProcess.exe : fatal error LNK1120: 1 个无法解析的外部命令   代码如下:   #pragma once typedef struct pcb
{
    CString name;
    int id;
    int priority;
    CString enterTime;
    int allTime;
    int usedTime;
    int readyTime;
    int runTime;
    CString state;
    struct pcb *next;
}PCB;
class CLinkQueue
{
public:
     CLinkQueue(void);
     ~CLinkQueue(void);
private:
     PCB *front;
     PCB *rear;
     int count;
public:
 int EmptyQueue()const;
    PCB* InitialPcb(CString,int,int);
 void InitialQueue(PCB *);
    int GetPriority(PCB *)const;
    CString GetName(PCB *)const;
    CString GetEnterTime(PCB *)const;
 int GetId(PCB *)const;
    int GetAllTime(PCB *)const;
    int GetUsedTime(PCB *)const;
    int GetRunTime(PCB *)const;
    CString GetState(PCB *)const;
    PCB* GetFront()const;
    PCB* GetRear()const;
    int GetCount()const;
    void EnterQueue(PCB *);
    int CheckQueue();
    void SetFrontState();
};     PCB* InitialPcb(CString newName,int newPriority,int newAllTime)
{
    PCB *p;
    p=new PCB;
    CTime t =CTime::GetCurrentTime();
    CString NowTime=t.Format("%H:%M:%S");
    p->enterTime=NowTime;
    p->name=newName;
    p->priority=newPriority;
    p->allTime=newAllTime;
    p->usedTime=0;
    p->runTime=0;
    p->readyTime=0;
    p->state="READY";
    p->next=NULL;
 return p;
}
    queue.InitialPcb(m_name,m_priority,m_alltime);