Skip to content

ld: cannot find crt2.o: No such file or directory #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ArtemGr opened this issue May 4, 2015 · 2 comments
Closed

ld: cannot find crt2.o: No such file or directory #88

ArtemGr opened this issue May 4, 2015 · 2 comments

Comments

@ArtemGr
Copy link
Contributor

ArtemGr commented May 4, 2015

Recently there's been a linking error building kernel32-sys with the latest Rust nightlies.

rustc --version: rustc 1.1.0-nightly (ce1150b9f 2015-05-04) (built 2015-05-04)

Building Racer:

smolny:~/rust/racer$ cargo build
   Compiling kernel32-sys v0.1.0
   Compiling bitflags v0.1.1
   Compiling libc v0.1.6
   Compiling rustc-serialize v0.3.14
   Compiling unicode-xid v0.0.1
error: linking with `gcc` failed: exit code: 1
note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-static-libgcc" "-m64" "-L" "C:\spool\Rust\bin\rust                                        lib\x86_64-pc-windows-gnu\lib" "-o" "C:\spool\cygwin\home\Artem\rust\racer\target\debug\build\kernel32-sys-852914e74bb6c4c5\build_script_bui                                        ld.exe" "C:\spool\cygwin\home\Artem\rust\racer\target\debug\build\kernel32-sys-852914e74bb6c4c5\build_script_build.o" "-Wl,--gc-sections" "-                                        L" "C:\spool\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib" "-lstd-4e7c5e5c" "-L" "C:\spool\cygwin\home\Artem\rust\racer\target\debug\deps" "-L                                        " "C:\spool\cygwin\home\Artem\rust\racer\target\debug\deps" "-L" "\\?\C:\spool\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib" "-L" "C:\spool\cy                                        gwin\home\Artem\rust\racer\.rust\bin\x86_64-pc-windows-gnu" "-L" "C:\spool\cygwin\home\Artem\rust\racer\bin\x86_64-pc-windows-gnu" "-Wl,--wh                                        ole-archive" "-Wl,-Bstatic" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-lws2_32" "-luserenv" "-lcompiler-rt"
note: ld: cannot find crt2.o: No such file or directory
ld: cannot find crtbegin.o: No such file or directory
ld: cannot find crtend.o: No such file or directory

error: aborting due to previous error
Build failed, waiting for other jobs to finish...
Could not compile `kernel32-sys`.

To learn more, run the command again with --verbose.

Verbose:

error: linking with `gcc` failed: exit code: 1
note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-static-libgcc" "-m64" "-L" "C:\spool\Rus
t\bin\rustlib\x86_64-pc-windows-gnu\lib" "-o" "C:\spool\cygwin\home\Artem\rust\racer\target\debug\build\kernel32-sys-852914e74bb6c
4c5\build_script_build.exe" "C:\spool\cygwin\home\Artem\rust\racer\target\debug\build\kernel32-sys-852914e74bb6c4c5\build_script_b
uild.o" "-Wl,--gc-sections" "-L" "C:\spool\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib" "-lstd-4e7c5e5c" "-L" "C:\spool\cygwin\home
\Artem\rust\racer\target\debug\deps" "-L" "C:\spool\cygwin\home\Artem\rust\racer\target\debug\deps" "-L" "\\?\C:\spool\Rust\bin\ru
stlib\x86_64-pc-windows-gnu\lib" "-L" "C:\spool\cygwin\home\Artem\rust\racer\.rust\bin\x86_64-pc-windows-gnu" "-L" "C:\spool\cygwi
n\home\Artem\rust\racer\bin\x86_64-pc-windows-gnu" "-Wl,--whole-archive" "-Wl,-Bstatic" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "
-lws2_32" "-luserenv" "-lcompiler-rt"
note: ld: cannot find crt2.o: No such file or directory
ld: cannot find crtbegin.o: No such file or directory
ld: cannot find crtend.o: No such file or directory

error: aborting due to previous error
Build failed, waiting for other jobs to finish...
Could not compile `kernel32-sys`.

Caused by:
  Process didn't exit successfully: `rustc C:\Users\Артем\.cargo\registry\src\github.com-1ecc6299db9ec823\kernel32-sys-0.1.0\build
.rs --crate-name build_script_build --crate-type bin -C prefer-dynamic -g --out-dir C:\spool\cygwin\home\Artem\rust\racer\target\d
ebug\build\kernel32-sys-852914e74bb6c4c5 --emit=dep-info,link -L dependency=C:\spool\cygwin\home\Artem\rust\racer\target\debug\dep
s -L dependency=C:\spool\cygwin\home\Artem\rust\racer\target\debug\deps -Awarnings` (exit code: 101)

C:\spool\cygwin\home\Artem\rust\racer>

Worked fine before.

I wonder if I'm not alone in seeing this problem?

@tomaka
Copy link
Contributor

tomaka commented May 4, 2015

You're probably seeing rust-lang/rust#25072
I don't think this is related to winapi-rs.

@ArtemGr
Copy link
Contributor Author

ArtemGr commented May 4, 2015

Right, thanks!

@ArtemGr ArtemGr closed this as completed May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants