----- Original Message -----
> From: "André Pang" <[email protected]>
> To: [email protected]
> Sent: Sunday, February 5, 2012 3:39:36 PM
> Subject: [rust-dev] error: can't find crate for 'core'
> 
> Hi!  I'm trying out rust for the first time, and successfully
> compiled and installed rustc.  I hit this error attempting to
> compile "hello world":
> 
> > ~ % cat hello.rs
> > use std;
> > fn main(args: [str]) {
> >     std::io::println("hello world from '" + args[0] + "'!");
> > }
> > ~ % rustc hello.rs
> > hello.rs:1:0: 1:0 error: can't find crate for 'core'
> > hello.rs:1 use std;
> >            ^

If you run again with "RUST_LOG=rustc::metadata::creader" you should get a 
bunch of information about where rustc is looking for the core crate. For 
example, when I compile something I see the following:

...
rust: "inspecting file 
/home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustc.so"
rust: "skipping 
/home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustc.so,
 doesn't look like libcore-*.
so"
rust: "inspecting file 
/home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore-14bd852465126fe7-0.1.so"
rust: 
"/home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore-14bd852465126fe7-0.1.so
 is a candidate"
rust: "matching 0 metadata requirements against 4 items"
rust: "crate metadata:"
rust: "  name = "core""
rust: "  vers = "0.1""
rust: "  uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8""
rust: "  url = "http://rust-lang.org/src/core"";
rust: "found 
/home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore-14bd852465126fe7-0.1.so
 with matching metadata"

On a 64-bit OS X system I would expect your rustc to find libcore at 
"../lib/rustc/x86_64-apple-darwin/lib/", with the path starting from the 
directory your rustc binary lives in. First I would check that you have a 
library called libcore-*-*.so living at that location and that rustc appears to 
be searching that location for crates.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to