You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to compile a project on Windows and I was getting linkage error. After some investigation I found the it has to do with opt-leve=z (set in Cargo.toml) and -Ctarget-feature=+crt-static (set in RUSTFLAGS env var). If I omit one of the two, the everything works, however this is not an option for the actual project.
@alexcrichton Since you have more experience for -sys and -src crates. Do you have any Ideas on how to fix this? /GL- is already used. Do you think that I should post this in Rust repo?
I'm not so certain myself unfortunately, but this looks like it's sort of a routine linking error where either the C standard library isn't specified or it's the wrong C standard library by accident (/MD vs /MT)
If I add -Copt-level=z in RUSTFLAGS, for some reason it works. In this case -Copt-level=3 -Copt-level=z is passed to rustc (the -Copt-level=3 part is added by cargo). This is more confusing.
I think I'm going to open an issue in Rust. It looks like a bug.
I tried to compile a project on Windows and I was getting linkage error. After some investigation I found the it has to do with
opt-leve=z
(set inCargo.toml
) and-Ctarget-feature=+crt-static
(set inRUSTFLAGS
env var). If I omit one of the two, the everything works, however this is not an option for the actual project.I created a repo with minimal example that reproduces the problem: oblique/optlevel-z-crt-static-issue.
You can view the linkage error here.
I have no idea why this is caused since I don't have a lot experience with Windows. Also I'm not sure if this is a bug in
rustc
.The error:
The text was updated successfully, but these errors were encountered: