PistonDevelopers / glfw-rs

GLFW3 bindings and idiomatic wrapper for Rust.
Apache License 2.0
647 stars 123 forks source link

How to use this in windows? #352

Open GraemeWilde opened 8 years ago

GraemeWilde commented 8 years ago

Could someone help me get this working in windows. I've got it set up as a dependency, I have default-features = false as the readme page specifies for windows. I tried setting a path to my GLFW compilation but that didn't work and the linker kept complaining that it couldn't find GLFW.lib, so I added a rust build script (build.rs) with println!("cargo:rustc-link-search=native=<path\\to\\folder\\containing\\glfw.lib>"); Now it no longer complains it can't find GLFW.lib, but I get 60 unresolved external symbol errors like the following:

glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_SystemParametersInfoW referenced in function _glfwPlatformInit
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_ChangeDisplaySettingsExW referenced in function _glfwSetVideoModeWin32
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplaySettingsW referenced in function _glfwPlatformGetVideoModes
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplaySettingsExW referenced in function _glfwPlatformGetMonitorPos

What am I doing wrong?

GraemeWilde commented 8 years ago

Hmm.. I switched from the MSVC version of rust to the GNU version of rust, and also switched from the MSVC GLFW binaries to the GNU ones and now everything works.. so I don't know if that means the issue is with Rust or what.