SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall CMSComm::GetRuntimeClass(void)const " (?GetRuntimeClass@CMSComm@@UBEPAUCRuntimeClass@@XZ)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: struct tagVARIANT __thiscall CMSComm::GetInput(void)" (?GetInput@CMSComm@@QAE?AUtagVARIANT@@XZ)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMSComm::SetInputLen(short)" (?SetInputLen@CMSComm@@QAEXF@Z)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMSComm::SetRThreshold(short)" (?SetRThreshold@CMSComm@@QAEXF@Z)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMSComm::SetInputMode(long)" (?SetInputMode@CMSComm@@QAEXJ@Z)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMSComm::SetSettings(char const *)" (?SetSettings@CMSComm@@QAEXPBD@Z)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMSComm::SetCommPort(short)" (?SetCommPort@CMSComm@@QAEXF@Z)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMSComm::SetPortOpen(int)" (?SetPortOpen@CMSComm@@QAEXH@Z)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: int __thiscall CMSComm::GetPortOpen(void)" (?GetPortOpen@CMSComm@@QAEHXZ)SCommTestDlg.obj : error LNK2001: unresolved external symbol "public: short __thiscall CMSComm::GetCommEvent(void)" (?GetCommEvent@CMSComm@@QAEFXZ)这是按照龚建伟串口调试助手打开和设置串口时,输入函数代码后出现的错误,请教是什么错误,该如何解决。
链接错误:出现这个2001错误,是因为链接失败,然而链接失败,又是因为以下原因: 1.你在头文件中声明了函数,但是cpp文件缺少了函数实现部分。
2.忘了将这个.h,.cpp Add to project;
3.以上两种情况都没有做,没有将它对应的lib文件添加到Setting-> LINK中