Hello,
I had a project in Visual Studio 2012 with working code that used SFML-2.1. I updated it to Visual Studio 2013 and quickly discovered that I needed to get the 2013 version of SFML libraries. Here are a few of the errors I got:
Error 162 error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1800' in <MyCodeFileNameHere>.obj
Error 197 error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (__imp_?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z) referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::_System_error_category::message(int)const " (?message@_System_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z) <PathHere>sfml-graphics-s-d.lib(GLCheck.cpp.obj)
Error 211 error LNK2001: unresolved external symbol "public: virtual void __thiscall std::basic_ios<char,struct std::char_traits<char> >::_Add_vtordisp2(void)" (?_Add_vtordisp2@?$basic_ios@DU?$char_traits@D@std@@@std@@UAEXXZ) <PathHere>sfml-graphics-s-d.lib(Shader.cpp.obj)
I would much prefer to simply download and use them, however there's no 2013 version on the SFML website and the only files I found for it in the forums were dynamic; I'm using the static libraries.
I got CMake gui to work properly using the tutorial: configure, configure, generate, etc. No problems. I used the VC++12 compiler option or whatever (version 12 is for VS2013).
Then I opened it in VS2013, built the debug and release libraries, copied them over into my now 2013 project, updated the include header files for SFML as well, and tried to run it. I got a whole bunch of linker errors that I have never seen before, which seem to be related to SFML's dependencies now. Here are a few:
Error 162 error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "private: void __thiscall sf::priv::GlContext::initialize(void)" (?initialize@GlContext@priv@sf@@AAEXXZ) <PathHere>sfml-window-s-d.lib(GlContext.obj)
Error 163 error LNK2001: unresolved external symbol __imp__glEnable@4 <PathHere>sfml-graphics-s-d.lib(RenderTarget.obj)
Error 169 error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ) <PathHere>sfml-window-s-d.lib(WglContext.obj)
Just for the heck of it I tried adding this line to my code:
#pragma comment(lib, "OpenGL32.lib")
The GL errors seem to go away, and now I seem to get GLEW errors. Is it possible that this statement in the CMake tutorial:
On Windows and Mac OS X, all the needed dependencies are provided directly with SFML, so you don't have to download/install anything. Compilation will work out of the box.
would somehow not be true? I followed the tutorial by the letter, I'm confident I did not miss anything, I triple checked that I used the updated version of SFML's include header files and library files, I tried running in release and debug mode, etc. What should I do?
Thanks,
- Andrew