c++ - 从 Visual Studio 2013 转换到 Visual Studio 2015 的问题

标签 c++ visual-studio visual-studio-2013 visual-studio-2015

我有一个庞大的 C++ 程序,到目前为止,我一直在使用 VS 2013 Express 进行处理。试用版结束,所以我决定转向 VS 2015 Professional。当我尝试编译和调试在 VS 2013 上完美运行的完全相同的代码时,我遇到了这些错误。我怎样才能使这项工作?

1main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RectangleShape::RectangleShape(class sf::RectangleShape &&)" (__imp_??0RectangleShape@sf@@QAE@$$QAV01@@Z) referenced in function "public: __thiscall entity::entity(class entity &&)" (??0entity@@QAE@$$QAV0@@Z)


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::RectangleShape & __thiscall sf::RectangleShape::operator=(class sf::RectangleShape &&)" (__imp_??4RectangleShape@sf@@QAEAAV01@$$QAV01@@Z) referenced in function "public: class entity & __thiscall entity::operator=(class entity &&)" (??4entity@@QAEAAV0@$$QAV0@@Z)


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Sprite::Sprite(class sf::Sprite &&)" (__imp_??0Sprite@sf@@QAE@$$QAV01@@Z) referenced in function "public: __thiscall entity::entity(class entity &&)" (??0entity@@QAE@$$QAV0@@Z)


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Sprite & __thiscall sf::Sprite::operator=(class sf::Sprite &&)" (__imp_??4Sprite@sf@@QAEAAV01@$$QAV01@@Z) referenced in function "public: class entity & __thiscall entity::operator=(class entity &&)" (??4entity@@QAEAAV0@$$QAV0@@Z)


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Text::Text(class sf::Text &&)" (__imp_??0Text@sf@@QAE@$$QAV01@@Z) referenced in function "public: __thiscall entity::entity(class entity &&)" (??0entity@@QAE@$$QAV0@@Z)


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Text & __thiscall sf::Text::operator=(class sf::Text &&)" (__imp_??4Text@sf@@QAEAAV01@$$QAV01@@Z) referenced in function "public: class entity & __thiscall entity::operator=(class entity &&)" (??4entity@@QAEAAV0@$$QAV0@@Z)


1>C:\SFML-2.3.2\SFML\Debug\SFML.exe : fatal error LNK1120: 6 unresolved externals

最佳答案

SFML 似乎注释了一些类,以便将它们的所有成员都放入 DLL 中。但是,VS2015 现在生成移动构造函数和移动赋值运算符,而 VS2013 没有,而且库似乎没有正确处理这个问题。所有缺少的符号都是这些新函数。

具体来说,编译器似乎没有在客户端程序中生成实现,因为它希望它们存在于 DLL 中,但它们不存在于 DLL 中。您是否重新编译了 DLL,或者您使用的是用于 VS2013 的同一个 DLL?重复使用旧的可能会导致此错误。

关于c++ - 从 Visual Studio 2013 转换到 Visual Studio 2015 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35309449/

相关文章:

c# - 错误 MSB3027 : Could not copy "C:\pagefile.sys" to "bin\roslyn\pagefile.sys". 超过重试次数 10。失败

c++ - HMAC_Init 在计算 HMAC-SHA1 时崩溃

c++ - 使用网络摄像头的高效肩膀检测技术

c# - 每个项目使用 GIT 时 Visual Studio 的行为是什么?

c# image filter parallel.for 需要更长的时间

Visual Studio 2013 中的 Silverlight 4 支持

c++ - 使用 NOLINT 抑制 clang-tidy。怎么才能压抑压抑?

c++ - 在类中传递 vector 而不复制

visual-studio-2010 - 是否可以在 Visual Studio 中重命名项目,使其文件夹名称也重命名?

asp.net - Visual Studio 2013在现有项目上更改身份验证