Hi guys,
I'm trying to use SFML with the newest Visual Studio version, 14 CTP. In order to compile it, I downloaded the newest snapshot from Github and generated project files for Visual Studio 13, which got upgraded on opening. After building the static SFML libraries, I combined them into one library using lib.exe.
The problem is that I get 4 linker errors when I try to compile a simple test program that only creates a sf::RenderWindow.
sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol _fprintf referenced in function _output_message
sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol ___iob_func referenced in function _output_message
sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol _sprintf referenced in function _format_message
sfml.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol _sscanf referenced in function _jinit_memory_mgr
I think the issue is about libjpeg. How can I debug this problem?
I switched over to Visual Studio 14 CTP because it adds support for std::integer_sequence which I want to use. As far as my experience goes, the CTP releases are already stable enough for a free time project. Is there a practical reason against combining the libs of one framework like SFML?
Thanks for pointing that CMake nightly already has support for VS14. This time, I also checked the option to add SFML examples to directly test if it works. Four of the examples failed to build because of linker errors for freetype.lib and jpeg.lib. Therefore, I downloaded the sources of the newest versions of both libraries and compiled them using VS14 in release mode with /MT. After copying those two libs to SFML\extlibs\libs-msvc\x86, only the opengl, pong and shader examples still fail to build. I already build newest GLEW because the failing examples are all OpenGL related, but it didn't help.
This is the part of the build log that shows the linker error. They're pretty similar to this problem description (http://en.sfml-dev.org/forums/index.php?topic=9338.0).
freetype.lib(ftbase.obj) : error LNK2001: unresolved external symbol __imp__strncpy
freetype.lib(truetype.obj) : error LNK2001: unresolved external symbol __imp__strstr
MSVCRT.lib(chandler4gs.obj) : error LNK2001: unresolved external symbol __except_handler4_common
C:\SFML\examples\pong\Release\pong.exe : fatal error LNK1120: 3 unresolved externals
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
freetype.lib(ftbase.obj) : error LNK2001: unresolved external symbol __imp__strncpy
freetype.lib(truetype.obj) : error LNK2001: unresolved external symbol __imp__strstr
MSVCRT.lib(chandler4gs.obj) : error LNK2001: unresolved external symbol __except_handler4_common
C:\SFML\examples\shader\Release\shader.exe : fatal error LNK1120: 3 unresolved externals
jpeg.lib(jerror.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
jpeg.lib(jerror.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Generating code
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
freetype.lib(ftbase.obj) : error LNK2001: unresolved external symbol __imp__strncpy
freetype.lib(truetype.obj) : error LNK2001: unresolved external symbol __imp__strstr
MSVCRT.lib(chandler4gs.obj) : error LNK2001: unresolved external symbol __except_handler4_common
C:\SFML\examples\opengl\Release\opengl.exe : fatal error LNK1120: 3 unresolved externals