[CLOSED] LWJGL3 does not build anymore under VS2013

Started by Kai, August 15, 2015, 21:26:47

Previous topic - Next topic

Kai

I get the following error message at the linking step:

-link:
   [Linker]    Creating library libs\lwjgl.lib and object libs\lwjgl.exp
   [Linker] glfw3.lib(init.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf referenced in function _glfwInputError
   [Linker] glfw3.lib(context.obj) : error LNK2019: unresolved external symbol __stdio_common_vsscanf referenced in function sscanf
   [Linker] libs\lwjgl.dll : fatal error LNK1120: 2 unresolved externals

BUILD FAILED
D:\downloads\lwjgl3-clean\build.xml:281: The following error occurred while executing this line:
D:\downloads\lwjgl3-clean\config\windows\build.xml:150: The following error occurred while executing this line:
D:\downloads\lwjgl3-clean\config\windows\build.xml:154: The following error occurred while executing this line:
D:\downloads\lwjgl3-clean\config\windows\build.xml:193: apply returned: 2


I used the ant build with the most current LWJGL3 git head (#74978442) and am building under Windows 7 x64 with VS2013.

spasi

Yes, sorry about that. The issue is that the C runtime is statically built into lwjgl.dll and its version must match the one used by glfw3.lib. The build server uses Visual Studio 2015 for everything as of build #15. I'm not sure if there's something I can do about this, will look into it tomorrow.

In the meantime, you could build GLFW locally and use that. Set LWJGL_BUILD_OFFLINE=true before linking LWJGL, otherwise ant will override your local glfw3.lib.

Kai

QuoteIn the meantime, you could build GLFW locally and use that. Set LWJGL_BUILD_OFFLINE=true before linking LWJGL, otherwise ant will override your local glfw3.lib.
Thank you! That worked. One part that was particularly painful however was that the cmake setup set the "RuntimeLibrary" to "MultiThreadedDLL" for the Release configuration in the GLFW vcxproj file. That resulted in GLFW dynamically linking against the standard runtime library and that then conflicted with LWJGL's link process, which statically links against the standard library.
Do you know of a command line switch or property for the cmake build of GLFW to tell it to statically link against the standard library? (I had to replace it manually in the vcxproj file for it to work).
Or asked another way: How does your build server setup the GLFW build?

spasi

Right, there's a cmake option for that, see this commit (USE_MSVC_RUNTIME_LIBRARY_DLL=OFF).

spasi

This issue can't be fixed without building multiple versions of the library dependencies. The CRT is not compatible across VS versions, though there is going to be some compatibility from now on (see The Great C Runtime Refactoring for details).

I don't think this is going to be a problem and LWJGL will simply require VS2015. The community edition is free and much better than the old express editions.