构建失败。错误 LNK2001:无法解析的外部符号
关于错误可能来自哪里有什么想法吗?当我构建解决方案时,我收到此构建失败消息。我有一个 MyFolder 程序文件夹,我复制并粘贴了该文件夹并将其命名为 MyFolder2(现在有两个不同的文件夹用于两个程序:MyFolder 和 MyFolder2)。我还进行了查找/替换,将文件夹中所有文件中的所有“MyFolder”替换为“MyFolder2”,并尽力确保区分大小写。 MyFolder 编译得很好。 MyFolder2 产生以下消息:
1>------ Build started: Project: MyFolder2, Configuration: Release x64 ------
1>Build started 2/15/2012 8:46:34 PM.
1>InitializeBuildStatus:
1> Touching "x64\Release\MyFolder2.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1> All outputs are up-to-date.
1> All outputs are up-to-date.
1>Link:
1> Creating library x64\Release\Homework_dlls\MyFolder2.lib and object x64
\Release\Homework_dlls\MyFolder2.exp
1>MyFolder.obj : error LNK2001: unresolved external symbol "public: static class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >
MyFolder2::m_HomeworkType" (?m_HomeworkType@MyFolder2@@2V?$basic_string@DU
?$char_traits@D@std@@V? $allocator@D@2@@std@@A)
1>x64\Release\Homework_dlls\MyFolder2.dll : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.09
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any thoughts on where the error may be coming from? I get this build failure message when I build my solution. I have a MyFolder program folder that I copied and pasted and named MyFolder2 (now have two distinct folders for two programs, MyFolder and MyFolder2). I also did a find/replace to replace all "MyFolder" with "MyFolder2" across all files in the folder and did my best to ensure case sensitivity. MyFolder compiled just fine. MyFolder2 produces the following message:
1>------ Build started: Project: MyFolder2, Configuration: Release x64 ------
1>Build started 2/15/2012 8:46:34 PM.
1>InitializeBuildStatus:
1> Touching "x64\Release\MyFolder2.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1> All outputs are up-to-date.
1> All outputs are up-to-date.
1>Link:
1> Creating library x64\Release\Homework_dlls\MyFolder2.lib and object x64
\Release\Homework_dlls\MyFolder2.exp
1>MyFolder.obj : error LNK2001: unresolved external symbol "public: static class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >
MyFolder2::m_HomeworkType" (?m_HomeworkType@MyFolder2@@2V?$basic_string@DU
?$char_traits@D@std@@V? $allocator@D@2@@std@@A)
1>x64\Release\Homework_dlls\MyFolder2.dll : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.09
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论