关于"error LNK2001: 无法解析的外部符号"
2012-07-22 13:13
375 查看
转载自:http://akheyun.blog.163.com/blog/static/1382492762010618105117528/
忘记曾经是哪个公司居然出了一道笔试题, 意思大概就是"error LNK2001: 无法解析的外部符号"这种错误出现在什么场合.
当时是英文版,没看懂单词意思,就胡乱帮他翻译下..
今天居然在写俄罗斯方块的时候被我遇到了.
出现场合:
定义了一个类,假设类内定义了一个int Solve(int); 函数, 但没有实现其内容.
在其他地方调用到这个Solve函数时,编译, 便会看到以下信息:
error LNK2001: 无法解析的外部符号 "public: int __thiscall CPlayer::Solve(int)" (?Solve@CPlayer@@QAEHH@Z)
1>D:\编程之美\vs2008代码\俄罗斯方块(GDI)\Debug\俄罗斯方块(GDI).exe : fatal error LNK1120: 1 个无法解析的外部命令
解决办法:
这样还能怎么解决? 当然是实现Solve函数
再编译, OK。
忘记曾经是哪个公司居然出了一道笔试题, 意思大概就是"error LNK2001: 无法解析的外部符号"这种错误出现在什么场合.
当时是英文版,没看懂单词意思,就胡乱帮他翻译下..
今天居然在写俄罗斯方块的时候被我遇到了.
出现场合:
定义了一个类,假设类内定义了一个int Solve(int); 函数, 但没有实现其内容.
在其他地方调用到这个Solve函数时,编译, 便会看到以下信息:
error LNK2001: 无法解析的外部符号 "public: int __thiscall CPlayer::Solve(int)" (?Solve@CPlayer@@QAEHH@Z)
1>D:\编程之美\vs2008代码\俄罗斯方块(GDI)\Debug\俄罗斯方块(GDI).exe : fatal error LNK1120: 1 个无法解析的外部命令
解决办法:
这样还能怎么解决? 当然是实现Solve函数
再编译, OK。
相关文章推荐
- error LNK2001: 无法解析的外部符号 "public: static struct QMetaObject const
- error LNK2001: 无法解析的外部符号 "class boost::system::error_category const & __cdecl boost::system::system_
- error LNK2001: 无法解析的外部符号 "class cocos2d::Vec2 const cocos2d::CCPointZero" (?CCPointZero@cocos2d@@3VV
- error LNK2001: 无法解析的外部符号 "class cocos2d::Vec2 const cocos2d::CCPointZero" (?CCPointZero@cocos2d@@3VV
- error LNK2001: 无法解析的外部符号 "__declspec(dllimport) void __cdecl google::InstallFailureSignalHandle
- error LNK2001: 无法解析的外部符号 "__declspec(dllimport)
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall Widget::metaObject
- error LNK2001: 无法解析的外部符号 "void * __cdecl operator new(unsigned int)"
- QT编程中编译的时候出现c_jkdacx0.obj : error LNK2001: 无法解析的外部符号 "class QTextCodec * GlobalCodec" ?
- QT中添加Q_OBJECT时编译提示obj : error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const错误解决方法
- vs2010+qt4编译出现error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject等错误
- error LNK2001: 无法解析的外部符号 "class std::basic_ostream<char,struct std::char_traits<char> > 的解决办法
- error LNK2001: 无法解析的外部符号 "public: virtual long __stdcall CBaseFilter
- error LNK2001: 无法解析的外部符号 "public: static class stdext::hash_map
- error LNK2001: 无法解析的外部符号 "__declspec(dllimport) protected: __thiscall std::_Container_base_aux_allo
- DLL编程中的"error LNK2001: 无法解析的外部符号"错误
- error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall Game::LevelTwo(void)"
- error LNK2001: 无法解析的外部符号 "public: virtual long __stdcall CBaseFilter
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall Widget::metaObject
- 关于在vs2005中出现: error LNK2001: 无法解析的外部符号 __security_cookie现象的处理办法