LWJGL Forum

Please login or register.

Login with username, password and session length

Author Topic: [CLOSED] LWJGL3 does not build anymore under VS2013  (Read 1447 times)

Kai

  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 870
[CLOSED] LWJGL3 does not build anymore under VS2013
« on: August 15, 2015, 21:26:47 »

I get the following error message at the linking step:

Code: [Select]
-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.
Logged

spasi

  • Administrator
  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 1746
Re: LWJGL3 does not build anymore under VS2013
« Reply #1 on: August 15, 2015, 22:28:03 »

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.
Logged

Kai

  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 870
Re: LWJGL3 does not build anymore under VS2013
« Reply #2 on: August 15, 2015, 22:52:43 »

Quote
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.
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?
Logged

spasi

  • Administrator
  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 1746
Re: LWJGL3 does not build anymore under VS2013
« Reply #3 on: August 16, 2015, 07:30:19 »

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

spasi

  • Administrator
  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 1746
Re: LWJGL3 does not build anymore under VS2013
« Reply #4 on: August 18, 2015, 07:46:07 »

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.
Logged