linebender / glazier

Deprecated Rust Window Creation Library
Apache License 2.0
206 stars 32 forks source link

OS Windows. linkage failed: unresolved external symbol error #156

Closed Sol-Ell closed 1 year ago

Sol-Ell commented 1 year ago

Error:

Linkage error

How did I get the error.

I recently moved from Linux to Windows and installed rust with msvc toolchain, added glazier as dependency. My code:

use glazier::Application;

fn main() {
    Application::new()
        .unwrap()
        .run(None);
}

Solution

As it turned out, there was an error in the "SHCreateItemFromParsingName" function, which is located in the Shell32 library. To fix this, just add

#[cfg(target_os = "windows")]
fn main() {
    println!("cargo:rustc-link-lib=Shell32");
}

into "build.rs".

waywardmonkeys commented 1 year ago

This is probably my fault and I know the right fix.

waywardmonkeys commented 1 year ago

PR #157 should fix this. My apologies for breaking it.

Sol-Ell commented 1 year ago

Thanks

golanguage commented 1 year ago

Have this issue been fixed? I have pull the newest code, but on my pc without this build.rs link.exe cannot work.

Sol-Ell commented 1 year ago

In my case the problem was solved. Could you provide more information about the error and if possible steps to reproduce it?

waywardmonkeys commented 1 year ago

@golanguage It should be fixed on main now ... make sure you pulled and got everything. I also had tested it myself when I wrote the patch last night.

As @Sol-Ell said, please provide more info and an example of what you're doing and we'll take a look!

golanguage commented 1 year ago

@golanguage It should be fixed on main now ... make sure you pulled and got everything. I also had tested it myself when I wrote the patch last night.

As @Sol-Ell said, please provide more info and an example of what you're doing and we'll take a look!

@waywardmonkeys Now is OK. May github pulling make some strange. I dont know .....

waywardmonkeys commented 1 year ago

No problem, great to hear that it is working for you now.