Compiling Error: linking with gcc
failed: exit code: 1
#17235
Labels
A-linkage
Area: linking into static, shared libraries and binaries
I am having trouble getting rustc to work on windows 7. I am getting an error 'linking with 'gcc' failed when trying to compile the hello-world example. In many of the other posts this was solved by updating gcc, so I tried this, but continue to get the error. Here is the output from running rustc -v, gcc -v, then rustc hellow_world.rs
Thanks in advance for any help!
Dan@LOOKOUT ~/Rust
$ ls
hello_world.metadata.o hello_world.o hello_world.rs
Dan@LOOKOUT ~/Rust
$ rustc -v
rustc 0.12.0-pre-nightly (09abbbd 2014-09-11 00:05:41 +0000)
Dan@LOOKOUT ~/Rust
$ gcc -v
Using built-in specs.
COLLECT_GCC=c:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=m
ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto
--enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++
,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-l
ibstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm
p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --
with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-
libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/
mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)
Dan@LOOKOUT ~/Rust
$ rustc hello_world.rs
error: linking with
gcc
failed: exit code: 1note: gcc '-m32' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\l
ib' '-o' 'hello_world.exe' 'hello_world.o' '-Wl,--whole-archive' '-lmorestack' '
-Wl,--no-whole-archive' '-Wl,--gc-sections' '-shared-libgcc' '-Wl,--enable-long-
section-names' '-Wl,--nxcompat' '-Wl,--dynamicbase' '-Wl,--large-address-aware'
'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libnative-4e7c5e5c.
rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libstd-4e7c5e
5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\librand-4e
7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libsyn
c-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\li
brustrt-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32
lib\libcollections-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-
pc-mingw32\lib\liballoc-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib
i686-pc-mingw32\lib\liblibc-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\bin\rust
lib\i686-pc-mingw32\lib\libunicode-4e7c5e5c.rlib' 'C:\Program Files (x86)\Rust\b
in\rustlib\i686-pc-mingw32\lib\libcore-4e7c5e5c.rlib' '-L' 'C:\Users\Dan\Rust.r
ust' '-L' 'C:\Users\Dan\Rust' '-Wl,--whole-archive' '-Wl,-Bstatic' '-Wl,--no-who
le-archive' '-Wl,-Bdynamic' '-lws2_32' '-lgcc_s' '-lcompiler-rt'
note: C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libstd-4e7c5e5
c.rlib(r-rust_builtin-rust_builtin.o): In function
gmtime': c:/program files (x86)/mingw-builds/x32-4.8.1-win32-dwarf-rev5/mingw32/i686-w64- mingw32/include/time.h:240: undefined reference to
_gmtime32'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libstd-4e7c5e5c.rlib
(r-rust_builtin-rust_builtin.o): In function
localtime': c:/program files (x86)/mingw-builds/x32-4.8.1-win32-dwarf-rev5/mingw32/i686-w64- mingw32/include/time.h:238: undefined reference to
_localtime32'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libstd-4e7c5e5c.rlib
(r-rust_builtin-rust_builtin.o): In function
mktime': c:/program files (x86)/mingw-builds/x32-4.8.1-win32-dwarf-rev5/mingw32/i686-w64- mingw32/include/time.h:239: undefined reference to
_mktime32'c:/program files (x86)/mingw-builds/x32-4.8.1-win32-dwarf-rev5/mingw32/i686-w64-
mingw32/include/time.h:239: undefined reference to `_mktime32'
collect2.exe: error: ld returned 1 exit status
error: aborting due to previous error
The text was updated successfully, but these errors were encountered: