Problem running "Hello world" after git clone "Linker error 1" #4925
Replies: 2 comments
-
addition: |
Beta Was this translation helpful? Give feedback.
-
The egui repo has a rust-toolchain file to pin the Rust version, so when you try to run, it installs that version of the toolchain if it isn't already installed, and uses it to build. But the file only specifies the version, so it will install the default target for the system, which for Windows is msvc. So it is trying to build with MSVC, which won't work if you don't have Visual Studio or Visual C++. You can force cargo to ignore the rust-toolchain file and use your default toolchain by specifying it in the command line:
Or you can create a [build]
target = "x86_64-pc-windows-gnu" Or you can just delete the rust-toolchain file, so cargo will use your default toolchain. Also note that the Windows GNU toolchain doesn't get much attention in egui, so it might not work anyway. Other people have had problems with it in the past, such as #2856. |
Beta Was this translation helpful? Give feedback.
-
I have cloned egui into a local folder and cannot translate "Hello World".
Message:
Compiling ahash v0.8.11
error: linking with
link.exe
failed: exit code: 1.Other sources can be compiled without errors?
It is noticeable that I get a new unexpected toolchain after starting the compiler with cargo run hello-world? I assume this is the problem. How i could solved the faulty behavior.
installed toolchains
stable-x86_64-pc-windows-gnu (default)
stable-x86_64-pc-windows-msvc
1.76.0-x86_64-pc-windows-msvc
Excerpt error image:
info: syncing channel updates for '1.76.0-x86_64-pc-windows-msvc'
info: latest update on 2024-02-08, rust version 1.76.0 (07dca489a 2024-02-04)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
Compiling proc-macro2 v1.0.76
Compiling windows_x86_64_msvc v0.48.5
Compiling serde v1.0.188
Compiling windows_x86_64_msvc v0.52.5
Compiling khronos_api v3.1.0
Compiling lock_api v0.4.10
Compiling parking_lot_core v0.
Translated with DeepL.com (free version)
Beta Was this translation helpful? Give feedback.
All reactions