LNK2001&的错误修复方法LNK2019 [英] How to fix error LNK2001 & LNK2019
问题描述
ProjectAAA.obj:错误LNK2001:无法解析的外部符号"public:__thiscall X :: ClassEvent :: ClassEvent(unsigned int)"(?? 0ClassEvent @ X @@ QAE @ I @ Z)
ProjectAAA.obj : error LNK2001: unresolved external symbol "public: __thiscall X::ClassEvent::ClassEvent(unsigned int)" (??0ClassEvent@X@@QAE@I@Z)
boost::shared_ptr<ClassEvent> bcfEvent(new ClassEvent((unsigned int) 10));
我已经定义了ClassEvent::ClassEvent(unsigned int)
,并且不知道如何解决此LINK错误.
I have defined ClassEvent::ClassEvent(unsigned int)
and have no idea how to fix this LINK errors.
任何建议都值得赞赏.
谢谢
更多信息:
1> ProjectAAA.obj:错误LNK2019:无法解析的外部符号"public:__thiscall APP :: X :: ClassEvent :: ClassEvent(unsigned int)"(?? 0ClassEvent @ X @ APP @@ QAE @ I @ Z)在函数"private:class std :: vector,class std :: allocator>> __thiscall APP :: X :: ProjectAAA :: GenerateEvents(class std :: map>> const&)"中引用(?GenerateEvents @ ProjectAAA @ X @ APP @@ AAE?AV?$ vector @ V?$ shared_ptr @ VClassEvent @ X @ APP @@@ boost @@ V?$ allocator @ V?$ shared_ptr @ VClassEvent @ X @ APP @@@ boost @@@ std @@@ std @@ ABV?$ map @ VDate @ APP @@ IUEventAttributesMapCompare @ ProjectAAA @ X @ 2 @ V?$ allocator @ U?$ pair @ $$ CBVDate @ APP @@ I @ std @@@ std @@ @ 5 @@ Z)
1>ProjectAAA.obj : error LNK2019: unresolved external symbol "public: __thiscall APP::X::ClassEvent::ClassEvent(unsigned int)" (??0ClassEvent@X@APP@@QAE@I@Z) referenced in function "private: class std::vector,class std::allocator > > __thiscall APP::X::ProjectAAA::GenerateEvents(class std::map > > const &)" (?GenerateEvents@ProjectAAA@X@APP@@AAE?AV?$vector@V?$shared_ptr@VClassEvent@X@APP@@@boost@@V?$allocator@V?$shared_ptr@VClassEvent@X@APP@@@boost@@@std@@@std@@ABV?$map@VDate@APP@@IUEventAttributesMapCompare@ProjectAAA@X@2@V?$allocator@U?$pair@$$CBVDate@APP@@I@std@@@std@@@5@@Z)
现在我已经完全隔离了错误:
1> ProjectAAA.obj:错误LNK2019:无法解析的外部符号"public:__thiscall APP :: X :: ClassEvent :: ClassEvent(unsigned int)"(?? 0ClassEvent @ X @ APP @@ QAE @ I @ Z)在函数私有:无效__thiscall APP :: X :: ProjectAAA :: TestGenerateEvents(void)"中引用(?TestGenerateEvents @ ProjectAAA @ X @ APP @@ AAEXXZ)
1>ProjectAAA.obj : error LNK2019: unresolved external symbol "public: __thiscall APP::X::ClassEvent::ClassEvent(unsigned int)" (??0ClassEvent@X@APP@@QAE@I@Z) referenced in function "private: void __thiscall APP::X::ProjectAAA::TestGenerateEvents(void)" (?TestGenerateEvents@ProjectAAA@X@APP@@AAEXXZ)
推荐答案
经过多次测试,我找到了解决方案.
After multiple testing, I found the solution.
团队中的某人从项目中排除了ClassEvent.CPP !!!
Someone in the team excludes the ClassEvent.CPP from the project!!!
这篇关于LNK2001&的错误修复方法LNK2019的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!