2016-02-10 115 views
0

我有一個C++的海量程序,到目前爲止我一直在使用VS 2013 Express。試用版結束後,我決定轉移到VS 2015 Professional。當我嘗試編譯和調試完全在VS 2013上工作的相同代碼時,我收到了這些錯誤。我該如何做這項工作?從Visual Studio 2013轉換到Visual Studio 2015的問題

1main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RectangleShape::RectangleShape(class sf::RectangleShape &&)" ([email protected]@@[email protected][email protected]@Z) referenced in function "public: __thiscall entity::entity(class entity &&)" ([email protected]@[email protected][email protected]@Z) 


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::RectangleShape & __thiscall sf::RectangleShape::operator=(class sf::RectangleShape &&)" ([email protected]@@[email protected][email protected]@Z) referenced in function "public: class entity & __thiscall entity::operator=(class entity &&)" ([email protected]@[email protected][email protected]@Z) 


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Sprite::Sprite(class sf::Sprite &&)" ([email protected]@@[email protected][email protected]@Z) referenced in function "public: __thiscall entity::entity(class entity &&)" ([email protected]@[email protected][email protected]@Z) 


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Sprite & __thiscall sf::Sprite::operator=(class sf::Sprite &&)" ([email protected]@@[email protected][email protected]@Z) referenced in function "public: class entity & __thiscall entity::operator=(class entity &&)" ([email protected]@[email protected][email protected]@Z) 


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Text::Text(class sf::Text &&)" ([email protected]@@[email protected][email protected]@Z) referenced in function "public: __thiscall entity::entity(class entity &&)" ([email protected]@[email protected][email protected]@Z) 


1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Text & __thiscall sf::Text::operator=(class sf::Text &&)" ([email protected]@@[email protected][email protected]@Z) referenced in function "public: class entity & __thiscall entity::operator=(class entity &&)" ([email protected]@[email protected][email protected]@Z) 


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

「試用版結束」 - 嗯? VS 2013 Express是免費的,你應該可以無限期地使用它。 – hvd

+0

鏈接器與VS 2013相同 – agtv

+0

那麼,我可以做些什麼來使其工作? – agtv

回答

4

SFML似乎註釋一些類,使所有成員都放在DLL。但是,VS2015現在生成移動構造函數和移動賦值運算符,VS2013沒有,並且看起來庫不能正確處理。所有缺失的符號都是這些新功能。

具體來說,它看起來像編譯器沒有在客戶端程序中生成實現,因爲它期望它們存在於DLL中,但它們不存在於DLL中。你重新編譯了DLL,還是使用了VS2013中使用的那個?重用舊版本可能會導致此錯誤。