重载流运算符后 LNK2019

雷神风暴烈酒 2014-05-02 01:22:06
我重载了<< 和>>运算符,包含了#include<fstream> 出现了下面的错误,求解答


1>Gamemanager.obj : error LNK2019: 无法解析的外部符号 __imp__fgetc,该符号在函数 "bool __cdecl std::_Fgetc<char>(char &,struct _iobuf *)" (??$_Fgetc@D@std@@YA_NAADPAU_iobuf@@@Z) 中被引用
1>Gamemanager.obj : error LNK2019: 无法解析的外部符号 __imp__fgetpos,该符号在函数 "protected: virtual class std::fpos<int> __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::seekoff(__int64,int,int)" (?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@_JHH@Z) 中被引用
1>Gamemanager.obj : error LNK2019: 无法解析的外部符号 __imp__fputc,该符号在函数 "bool __cdecl std::_Fputc<char>(char,struct _iobuf *)" (??$_Fputc@D@std@@YA_NDPAU_iobuf@@@Z) 中被引用
1>Gamemanager.obj : error LNK2019: 无法解析的外部符号 __imp__fsetpos,该符号在函数 "protected: virtual class std::fpos<int> __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::seekpos(class std::fpos<int>,int)" (?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z) 中被引用
1>Gamemanager.obj : error LNK2019: 无法解析的外部符号 __imp___fseeki64,该符号在函数 "protected: virtual class std::fpos<int> __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::seekoff(__int64,int,int)" (?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@_JHH@Z) 中被引用
1>Gamemanager.obj : error LNK2019: 无法解析的外部符号 __imp__fwrite,该符号在函数 "protected: bool __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::_Endwrite(void)" (?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ) 中被引用
1>Gamemanager.obj : error LNK2019: 无法解析的外部符号 __imp__setvbuf,该符号在函数 "protected: virtual class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::setbuf(char *,__int64)" (?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAD_J@Z) 中被引用
1>Gamemanager.obj : error LNK2019: 无法解析的外部符号 __imp__ungetc,该符号在函数 "bool __cdecl std::_Ungetc<char>(char const &,struct _iobuf *)" (??$_Ungetc@D@std@@YA_NABDPAU_iobuf@@@Z) 中被引用
1>D:\c++\MyGame\Debug\MyGame.exe : fatal error LNK1120: 8 个无法解析的外部命令

...全文
189 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
「已注销」 2014-05-02
  • 打赏
  • 举报
回复
无法解析的外部符号,一般是指只有头文件,而没有对应的库文件
熊熊大叔 2014-05-02
  • 打赏
  • 举报
回复
你重载的有问题,把你的源代码贴出来看看
mujiok2003 2014-05-02
  • 打赏
  • 举报
回复
重建工程实施试试,貌似你的CRT没有连接成功。
YCMyTot 2014-05-02
  • 打赏
  • 举报
回复
重载 运算符 时 ,应该 加一个 friend 友元函数

64,637

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧