另一个 LNK2019:未解析的外部符号
我正在为学校项目创建主干,但遇到了“无法解析的外部符号”错误。根据本网站之前提到的问题,我认为必须手动将我的项目链接到 .lib 文件。问题是,我不知道需要链接到哪个 .lib。有人能像我十二岁一样解释一下吗?
1>------ Build started: Project: Birthday311, Configuration: Debug Win32 ------
1>Build started 2/2/2012 07:55:30 PM.
1>InitializeBuildStatus:
1> Touching "Debug\Birthday311.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: int __thiscall Birthday::getDay(void)const " (?getDay@Birthday@@QBEHXZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" (?test_class_Birthday_default_ctor@@YAXAAVTester@@@Z)
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: int __thiscall Birthday::getMonth(void)const " (?getMonth@Birthday@@QBEHXZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" (?test_class_Birthday_default_ctor@@YAXAAVTester@@@Z)
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Birthday::getName(void)const " (?getName@Birthday@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" (?test_class_Birthday_default_ctor@@YAXAAVTester@@@Z)
1>C:\Users\Ender\Documents\Visual Studio 2010\Projects\Birthday311\Debug\Birthday311.exe : fatal error LNK1120: 3 unresolved externals
I'm creating a backbone for a school project, but I'm running into "unresolved external symbol" errors. According to previous problems mentioned on this site, I think have to manually link my project to a .lib file. Problem is, I don't know exactly which .lib I need to link to. Can someone explain like I'm twelve?
1>------ Build started: Project: Birthday311, Configuration: Debug Win32 ------
1>Build started 2/2/2012 07:55:30 PM.
1>InitializeBuildStatus:
1> Touching "Debug\Birthday311.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: int __thiscall Birthday::getDay(void)const " (?getDay@Birthday@@QBEHXZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" (?test_class_Birthday_default_ctor@@YAXAAVTester@@@Z)
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: int __thiscall Birthday::getMonth(void)const " (?getMonth@Birthday@@QBEHXZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" (?test_class_Birthday_default_ctor@@YAXAAVTester@@@Z)
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Birthday::getName(void)const " (?getName@Birthday@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" (?test_class_Birthday_default_ctor@@YAXAAVTester@@@Z)
1>C:\Users\Ender\Documents\Visual Studio 2010\Projects\Birthday311\Debug\Birthday311.exe : fatal error LNK1120: 3 unresolved externals
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您实际上并没有实现 getDay、getMonth 和 getName 函数。
Seems like you didn't actually implement the functions getDay, getMonth, and getName.