Ask questionsbuild an empty project failed (undefined reference to `__onexitbegin')
toolchain:
nightly-x86_64-pc-windows-msvc (default)
rustc 1.26.0-nightly (521d91c6b 2018-03-14)
build command: cargo run --target x86_64-pc-windows-gnu
error message:
.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-gnu\lib\crt2.o:crtexe.c:(.rdata$.refptr.__onexitbegin[.refptr.__onexitbegin]+0x0): undefined reference to `__onexitbegin'
.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-gnu\lib\crt2.o:crtexe.c:(.rdata$.refptr.__onexitend[.refptr.__onexitend]+0x0): undefined reference to `__onexitend'
collect2.exe: error: ld returned 1 exit status
possible reason:
rustc bug?
rustlib bug?
msys2 gcc issues?
Answer
questions
mati865
@rustbot modify labels: -O-windows +O-windows-gnu
@azymohliad you can use workaround from https://github.com/rust-lang/rust/issues/47048 but change paths for Linux.
Related questions