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

error: linking with link.exe failed: exit code: 1120 #1437

Closed
dulguun0225 opened this issue Feb 4, 2020 · 6 comments
Closed

error: linking with link.exe failed: exit code: 1120 #1437

dulguun0225 opened this issue Feb 4, 2020 · 6 comments
Labels
B - bug Dang, that shouldn't have happened DS - windows F - duplicate This issue or pull request already exists

Comments

@dulguun0225
Copy link

dulguun0225 commented Feb 4, 2020

main.rs

use winit::{
    event::{Event, WindowEvent},
    event_loop::{ControlFlow, EventLoop},
    window::WindowBuilder,
};

fn main() {
    let event_loop = EventLoop::new();
    let window = WindowBuilder::new().build(&event_loop).unwrap();

    event_loop.run(move |event, _, control_flow| {
        *control_flow = ControlFlow::Poll;

        match event {
            Event::WindowEvent {
                event: WindowEvent::CloseRequested,
                ..
            } => {
                println!("The close button was pressed; stopping");
                *control_flow = ControlFlow::Exit
            }
            Event::MainEventsCleared => {
                window.request_redraw();
            }
            Event::RedrawRequested(_) => {
            }
            _ => (),
        }
    });
}

Cargo.toml

[package]
name = "gfx_hal_sample"
version = "0.1.0"
authors = ["Dulguun Otgon <dulguun0225@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
winit = "0.20.0"

Output of cargo run

error: linking with `link.exe` failed: exit code: 1120                                            
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.11lcdzouqeymt22d.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.16sabsxv0lnlex7n.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1722fc6nv42ixkmn.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.190locoqxthhdpav.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.19xetf6v3gffea26.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1d437htom44lz54.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1fwwc5e2wfolqmx2.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1irhqpyx5bdhe66v.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1kb30m7txy4tid42.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1kyuqf7dd0kbvv38.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1ml8onvatdsvaszw.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1ml9g820c6jpzd9i.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1p3zrv8c7u2o9dp2.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1p8hsyqa19qnahvn.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1q353tbbco377t1z.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1r029irepjmal0to.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1sper7ranotv8pge.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.1yqnkd760qmd1vg5.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2672tqbo76s15f53.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.278y3k1gq2p2rdwk.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2d96sn05mh3uq5rd.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2hr4b3ef6w662co5.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2imjokrolf34y9l4.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2izy0ufaoy1sxbp8.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2jttp1qsvreydb7s.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2uuboniyvghg89wz.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2x4fwaue6k0ga2ue.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2x9lt498qqlh5qxb.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.304gpoy3yzbfkat7.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.343vcw8bj2vluuuq.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.35nkmbdwqc3ndukd.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.37wb7c9iqvzl7ior.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.3cw6moijgc1s5wln.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.3dvtz57px8vpk8yr.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.3pqhcnegga29hepu.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.3rcszvhmy3fp1che.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.3uywtgc1ouxi1ezp.rcgu.o"
"D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.3vrgoxz7qltq8nh7.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.3we0onba7k13tw0n.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.3ypufs89xjvri7cj.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.41ao3d3tymdlusw5.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.45j5wkbvu2szewkn.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4eudbt2o9mdhr75g.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4fhhmudcdjwyt0mv.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4hgdj47fnn9jw71i.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4hjjk6xrh6dn32g2.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4hk27kry2exyxqns.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4m17by7jm1w4eogj.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4muhea1yp928sq29.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4q7w6ptksh7wcjp9.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4rf4nyq4v34soa5v.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4wbl9k3m8o5p8dfh.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4womgjcv21iu68a1.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.4zcu1wq1d27jfnk4.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.50xsvmjt8z3m6rxe.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.54zhu5gdius9fk0p.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.59oozkx0yygi4g43.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.5bvqif9fl2vvm6y1.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.5da2u13u6627eozs.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.5g0b2pmuzkhznfhd.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.7ftwkyi38vmym1x.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.8063alqd0jvu6hb.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.eqxihqju91w6yiv.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.hxcsu9l1ghjt8hc.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.i61lbn473dl86zr.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.kca11k9fu8j8d3v.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.l4k40qfvjqyu7nw.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.pmmwixkqj6bz650.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.vmh18gfx7twceh8.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.w98aaxk2t9samfo.rcgu.o" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.wagfuyhngnu2h12.rcgu.o" "/OUT:D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.exe" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\gfx_hal_sample.2uthn7yrj1x9doc7.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis" "/LIBPATH:D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps" "/LIBPATH:C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libwinit-3c5e92e48f956a67.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libraw_window_handle-414b70b39d08afc1.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\liblibc-16e95c3c28f895c1.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libparking_lot-e1cdb88fe02a6127.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libparking_lot_core-be02e4b9edfb5af3.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libsmallvec-99189dd1caab36e1.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\liblock_api-752f68f885f95e6f.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libscopeguard-acb8f5fc2f69d982.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libwinapi-76805b3fd632f23e.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libinstant-860ef685e34c3c36.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libbitflags-5d7cec28dca559dc.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\liblog-5f9107f1f7ae4c51.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\libcfg_if-2fc5ec101de62cb7.rlib" "D:\\workspaces\\rs\\gfx_hal_sample\\target\\debug\\deps\\liblazy_static-dfee64d5a60b35d2.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-1f238888c84774e2.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-d8f151518bb4c57c.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-74266904899dc245.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-51f2cd471cdfc396.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libbacktrace-dce1430caacd4770.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-6d52e6deaec7cf95.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-dbb085221d1acb15.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-d8cc0a94c0c8a864.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-ee75f5de884abde6.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-8aecd5c37fa55150.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-d895cc5a4bb533f7.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-6cba9134ca8058d2.rlib" "C:\\Users\\Dell\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-c24e965c1f22f6cd.rlib" "advapi32.lib" "cfgmgr32.lib" "comctl32.lib" "dwmapi.lib" "fwpuclnt.lib" "gdi32.lib"
"kernel32.lib" "msimg32.lib" "ntdll.lib" "ole32.lib" "opengl32.lib" "shcore.lib" "shell32.lib" "shlwapi.lib" "user32.lib" "uxtheme.lib" "winspool.lib" "ws2_32.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
  = note: gfx_hal_sample.2hr4b3ef6w662co5.rcgu.o : error LNK2019: unresolved external symbol AdjustWindowRectExForDpi referenced in function _ZN5winit13platform_impl8platform10event_loop22public_window_callback17h8419182623f9f423E
          D:\workspaces\rs\gfx_hal_sample\target\debug\deps\gfx_hal_sample.exe : fatal error LNK1120: 1 unresolved externals
 
 
error: aborting due to previous error

However when I clone the winit repo and run the examples it works fine.

@goddessfreya goddessfreya added DS - windows F - duplicate This issue or pull request already exists B - bug Dang, that shouldn't have happened labels Feb 5, 2020
@goddessfreya
Copy link
Contributor

Dupe: #1386

@dulguun0225
Copy link
Author

It seems the PR is already merged, but I'm getting this on windows 10

@goddessfreya
Copy link
Contributor

We have not pushed a new version to crates.io, but it is fixed on master, as you've noted with the examples working fine.

@dulguun0225
Copy link
Author

When will the new version be available on crates.io?

@dulguun0225
Copy link
Author

In the meantime I guess I'm gonna use it like this

[dependencies]
winit = { git = "https://github.com/rust-windowing/winit", branch = "master" }

@goddessfreya
Copy link
Contributor

#1440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - windows F - duplicate This issue or pull request already exists
Development

No branches or pull requests

2 participants