当前位置: 代码迷 >> VC >> error LNK2001: 无法解析的外部符号 异常
  详细解决方案

error LNK2001: 无法解析的外部符号 异常

热度:394   发布时间:2016-05-05 00:01:10.0
error LNK2001: 无法解析的外部符号 错误
1>------ 已启动生成: 项目: DigitalScan, 配置: Debug Win32 ------
1>正在编译...
1>WorkBooks.cpp
1>正在链接...
1>   正在创建库 ../../../lib/DigitalScanD.lib 和对象 ../../../lib/DigitalScanD.exp
1>DigitalScanD.exp : warning LNK4070: .EXP 中的 /OUT:DigitalScan.dll 指令与输出文件名“../../../debug/DigitalScanD.dll”不同;忽略指令
1>RimSampleCreater.obj : error LNK2019: 无法解析的外部符号 "private: int __thiscall CRimSampleCreater::CreateOneFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class Segment const &,__int64)" ([email protected]@@[email protected][email protected]@std@@[email protected]@2@@std@@000ABVSegment@@[email protected]),该符号在函数 "private: int __thiscall CRimSampleCreater::CreateSampleFiles(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class FSegment const &,__int64)" ([email protected]@@[email protected][email protected][email protected]@std@@[email protected]@2@@std@@[email protected][email protected][email protected]@std@@[email protected]@2@@std@@@2@@std@@[email protected][email protected]@std@@[email protected]@2@@[email protected]@@[email protected]) 中被引用
1>RimSampleCreater.obj : error LNK2019: 无法解析的外部符号 "private: int __thiscall CRimSampleCreater::AddSampleData(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class DataOp const &,class Segment const &)" ([email protected]@@[email protected][email protected]@std@@[email protected]@2@@std@@ABVDataOp@@ABVSegment@@@Z),该符号在函数 "private: int __thiscall CRimSampleCreater::AddAllSampleData(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > &,class DataOp const &,class FSegment const &)" ([email protected]@@[email protected][email protected][email protected]@std@@[email protected]@2@@std@@[email protected][email protected][email protected]@std@@[email protected]@2@@std@@@2@@std@@ABVDataOp@@ABVFSegment@@@Z) 中被引用
1>RtmService.obj : error LNK2019: 无法解析的外部符号 "public: virtual void __thiscall Xrmrtm::Xrmrtm__RtmTask::soap_default(struct soap *)" ([email protected][email protected]@@UAEXPAUsoap@@@Z),该符号在函数 "public: __thiscall Xrmrtm::Xrmrtm__RtmTask::Xrmrtm__RtmTask(void)" ([email protected]@@[email protected]) 中被引用
1>RtmService.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall Xrmrtm::Xrmrtm__RtmTask::soap_serialize(struct soap *)const " ([email protected][email protected]@@UBEXPAUsoap@@@Z)
1>RtmService.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall Xrmrtm::Xrmrtm__RtmTask::soap_put(struct soap *,char const *,char const *)const " ([email protected][email protected]@@UBEHPAUsoap@@[email protected])
1>RtmService.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall Xrmrtm::Xrmrtm__RtmTask::soap_out(struct soap *,char const *,int,char const *)const " ([email protected][email protected]@@UBEHPAUsoap@@[email protected])
1>RtmService.obj : error LNK2001: 无法解析的外部符号 "public: virtual void * __thiscall Xrmrtm::Xrmrtm__RtmTask::soap_get(struct soap *,char const *,char const *)" ([email protected][email protected]@@UAEPAXPAUsoap@@[email protected])
1>RtmService.obj : error LNK2001: 无法解析的外部符号 "public: virtual void * __thiscall Xrmrtm::Xrmrtm__RtmTask::soap_in(struct soap *,char const *,char const *)" ([email protected][email protected]@@UAEPAXPAUsoap@@[email protected])
1>RtmService.obj : error LNK2019: 无法解析的外部符号 "public: virtual void __thiscall Xrmrtm::_Xrmrtm__CreateRtmTask::soap_default(struct soap *)" (?soap_default@[email protected]@@UAEXPAUsoap@@@Z),该符号在函数 "public: __thiscall Xrmrtm::_Xrmrtm__CreateRtmTask::_Xrmrtm__CreateRtmTask(void)" ([email protected]@@[email protected]) 中被引用
1>RtmService.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall Xrmrtm::_Xrmrtm__CreateRtmTask::soap_serialize(struct soap *)const " (?soap_serialize@[email protected]@@UBEXPAUsoap@@@Z)
1>RtmService.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall Xrmrtm::_Xrmrtm__CreateRtmTask::soap_put(struct soap *,char const *,char const *)const " (?soap_put@[email protected]@@UBEHPAUsoap@@[email protected])
1>../../../debug/DigitalScanD.dll : fatal error LNK1120: 618 个无法解析的外部命令
1>生成日志保存在“file://f:\RIM\client1\intermediate\DigitalScan_VC90\Debug\BuildLog.htm”
1>DigitalScan - 661 个错误,1 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========


网上找了很多贴,都没解决。
------解决思路----------------------
将整个bin目录删除了重新生成一次。
------解决思路----------------------
少了好几个.lib库文件了。好好看下你的工程项目包含了什么头文件,然后将这些lib包含进来。
------解决思路----------------------
大概浏览了下,发现基本上都是 virtual 虚函数报错。

虽然我不能确定问题所在,但我以前也遇到过类似的错误,问题就在于我当时在.h头文件中只是定义了 virtual 函数,并未具体实现,后来随便加个 { return true; }, 或者 { ; } 这样的空操作后,编译就通过了。反正 virtual 函数都要被继承类运行时覆盖,随便写就行。
  相关解决方案