Reputation: 127
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
Upvotes: 0
Views: 215
Reputation: 71899
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.
Upvotes: 4