学而思,思而行

学而思,思而行 <1>
一个link 2019的错误,一直没有解决思路,最后解决掉,把思路记录下
error msg:

UpDlgView.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CMarkup::~CMarkup(void)" ( __imp_??1CMarkup@@QAE@XZ) referenced in function "public: void __thiscall CUpDlgView::OnButtonadd(void)" ( ?OnButtonadd@CUpDlgView@@QAEXXZ)

UpDlgView.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall CMarkup::AddElem(char const *,char const *,int)" ( __imp_?AddElem@CMarkup@@QAE_NPBD0H@Z) referenced in function "public: void __thiscall CUpDlgView::OnButtonadd(void)" ( ?OnButtonadd@CUpDlgView@@QAEXXZ)

UpDlgView.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CMarkup::CMarkup(void)" ( __imp_??0CMarkup@@QAE@XZ) referenced in function "public: void __thiscall CUpDlgView::OnButtonadd(void)" ( ?OnButtonadd@CUpDlgView@@QAEXXZ)

分析:
错误的类别是:unresolved external symbol ,是一个没有解决的外部变量,因为一直认为第三方类不可能有错误所以一直在自己编写的代码中寻找错误,其实错误的关键在这里:"__declspec(dllimport)" 这说明这是一个外部导出类,所以需要 将class  AFX_EXT_CLASS CMarkup 改为 class CMarkUp .








你可能感兴趣的:(学而思,思而行)