Skip to content

MSVC link errors with __imp_ symbols #56839

Closed
@aloucks

Description

@aloucks

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions