Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker errors on windows #22

Open
arturoc opened this issue May 19, 2022 · 0 comments
Open

Linker errors on windows #22

arturoc opened this issue May 19, 2022 · 0 comments

Comments

@arturoc
Copy link

arturoc commented May 19, 2022

When trying to compile an application dependent on glfw 0.44 in windows I'm getting:

libglfw-76f95f4482011d20.rlib(monitor.obj) : error LNK2019: unresolved external symbol __imp_strncpy referenced in function _glfwAllocMonitor
          libglfw-76f95f4482011d20.rlib(window.obj) : error LNK2001: unresolved external symbol __imp_strncpy
          libglfw-76f95f4482011d20.rlib(input.obj) : error LNK2001: unresolved external symbol __imp_strncpy
          libglfw-76f95f4482011d20.rlib(win32_joystick.obj) : error LNK2001: unresolved external symbol __imp_strncpy
          libglfw-76f95f4482011d20.rlib(monitor.obj) : error LNK2019: unresolved external symbol __imp_realloc referenced in function _glfwInputMonitor
          libglfw-76f95f4482011d20.rlib(input.obj) : error LNK2001: unresolved external symbol __imp_realloc
          libglfw-76f95f4482011d20.rlib(win32_monitor.obj) : error LNK2001: unresolved external symbol __imp_realloc
          libglfw-76f95f4482011d20.rlib(osmesa_context.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(wgl_context.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(win32_thread.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(vulkan.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(egl_context.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(monitor.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(context.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(window.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(input.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libglfw-76f95f4482011d20.rlib(context.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vsscanf referenced in function sscanf
          libglfw-76f95f4482011d20.rlib(input.obj) : error LNK2019: unresolved external symbol __imp_strcspn referenced in function glfwUpdateGamepadMappings
          libglfw-76f95f4482011d20.rlib(input.obj) : error LNK2019: unresolved external symbol __imp_strspn referenced in function glfwUpdateGamepadMappings

Following this issue on the original glfw repo: glfw#1981

This can be solved by adding the following lines to the current build.rs script:

#[cfg(target_os="windows")]
cfg.define("CMAKE_MSVC_RUNTIME_LIBRARY", "MultiThreaded$<$<CONFIG:Debug>:Debug>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant