构建失败。错误 LNK2001:无法解析的外部符号

发布于 2025-01-05 21:11:24 字数 1267 浏览 0 评论 0原文

关于错误可能来自哪里有什么想法吗?当我构建解决方案时,我收到此构建失败消息。我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文