Closed
Description
Building the hello world program fails with the following message:
error: linking with `gcc` failed: exit code: 1
note: gcc '-m64' [snip]
note: C:\Tools\Rust\bin\rustlib\x86_64-w64-mingw32\lib\libnative-4e7c5e5c.rlib(native-4e7c5e5c.o):(.text+0x89): undefined reference to `_Unwind_Resume'
C:\Tools\Rust\bin\rustlib\x86_64-w64-mingw32\lib\libnative-4e7c5e5c.rlib(native-4e7c5e5c.o):(.text+0x5bb): undefined reference to `_Unwind_Resume'
C:\Tools\Rust\bin\rustlib\x86_64-w64-mingw32\lib\libnative-4e7c5e5c.rlib(native-4e7c5e5c.o):(.text+0x12c8): undefined reference to `_Unwind_Resume'
C:\Tools\Rust\bin\rustlib\x86_64-w64-mingw32\lib\libnative-4e7c5e5c.rlib(native-4e7c5e5c.o):(.text+0x1396): undefined reference to `_Unwind_Resume'
C:\Tools\Rust\bin\rustlib\x86_64-w64-mingw32\lib\libnative-4e7c5e5c.rlib(native-4e7c5e5c.o):(.text+0x1463): undefined reference to `_Unwind_Resume'
C:\Tools\Rust\bin\rustlib\x86_64-w64-mingw32\lib\libnative-4e7c5e5c.rlib(native-4e7c5e5c.o):(.text+0x1781): more undefined references to `_Unwind_Resume' follow
c:/tools/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Tools\Rust\bin\rustlib\x86_64-w64-mingw32\lib\libnative-4e7c5e5c.rlib(native-4e7c5e5c.o): bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status
It appears that rustc picks up another MingW's version of ld
rather than the one it ships with. The same error also appears if the rust binary directory is the first item in my PATH. The only way around it is to either remove my MingW's bin
directory from the PATH or by prefixing rustlib/...mingw/gcc/bin
to the PATH. Both solutions seem to be quite hackish -- I just wanted to check if this is the desired behavior.