-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Description
Symbols starting with __imp_
are failing to link on the latest nightly.
Cargo.toml:
[package]
name = "msvc_link_bug"
version = "0.1.0"
edition = "2018"
[dependencies]
glfw = "0.25"
src/main.rs:
use glfw;
fn main() {
let _glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
}
nightly-2018-12-14-x86_64-pc-windows-msvc <-- works
nightly-2018-12-15-x86_64-pc-windows-msvc <-- link errors
= note: libglfw-2c7b0cf6c8d5aea7.rlib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragQueryFileW referenced in function windowProc
libglfw-2c7b0cf6c8d5aea7.rlib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragQueryPoint referenced in function windowProc
libglfw-2c7b0cf6c8d5aea7.rlib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragFinish referenced in function windowProc
libglfw-2c7b0cf6c8d5aea7.rlib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragAcceptFiles referenced in function createNativeWindow
C:\temp\msvc_link_bug\target\debug\deps\msvc_link_bug-e81b7a96ee14e48a.exe : fatal error LNK1120: 4 unresolved externals
Maybe related: #56807
Activity
[-]Link errors with MSVC __imp_ symbols[/-][+]MSVC link errors with __imp_ symbols[/+]nikic commentedon Dec 15, 2018
Probably due to #56568. At least the first symbol is part of shell32.dll.
Possibly glfw (or whatever is using those) may need to explicitly declare this dependency now that it's no longer implicitly provided.
nikic commentedon Dec 15, 2018
cc @notriddle @alexcrichton
alexcrichton commentedon Dec 15, 2018
Indeed all those symbols are in shell32.dll which was removed from the standard library in the PR @nikic mentioned.
@aloucks the "best" fix here would be for the glfw crate to link to shell32 itself, but do you know if it's possible to get a point release doing that? If it's difficult we could re-add it to libstd for the time being.
Link shell32 on windows
aloucks commentedon Dec 19, 2018
PistonDevelopers/glfw-rs#394
Added shell32 lib to link against