简体   繁体   中英

Problems converting from Visual Studio 2013 to Visual Studio 2015

I have a massive program in C++ that up to this point I have been working on using VS 2013 Express. The trial version ended so I decided to move to VS 2015 Professional. When I try to compile and debug the same exact code that works perfectly on VS 2013, I get these errors. How can I make this work?

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 appears to annotate some classes so that all their members are put in the DLL. However, VS2015 now generates move constructors and move assignment operators, which VS2013 didn't, and it appears that the library doesn't handle this correctly. All the missing symbols are these new functions.

Specifically, it looks like the compiler didn't generate implementations in the client program, because it expected them to exist in the DLL, but they don't exist in the DLL. Did you recompile the DLL, or are you using the same one you were using for VS2013? Reusing the old one could lead to this error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM