Skip to content

Fails to compile #64

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
turbolent opened this issue Oct 10, 2014 · 2 comments
Closed

Fails to compile #64

turbolent opened this issue Oct 10, 2014 · 2 comments

Comments

@turbolent
Copy link

I'm just getting started with Rust and wanted to try using a Postgres database, so I created a new project with cargo, and added rust-postgres as a dependency:

[dependencies.postgres]
git = "https://github.com/sfackler/rust-postgres.git"

The compilation then fails as follows:

$ cargo run --verbose
       Fresh phf v0.0.0 (https://github.com/sfackler/rust-phf#996edc69)
       Fresh phf_mac v0.0.0 (https://github.com/sfackler/rust-phf#996edc69)
       Fresh openssl v0.0.0 (https://github.com/sfackler/rust-openssl#c407530d)
   Compiling postgres v0.0.0 (https://github.com/sfackler/rust-postgres.git#abd60ef1)
     Running `rustc src/lib.rs --crate-name postgres --crate-type lib -g -C metadata=1731918feb625991 -C extra-filename=-1731918feb625991 --out-dir /Users/bastian/projects/rust-test/target/deps --dep-info /Users/bastian/projects/rust-test/target/.fingerprint/postgres-1731918feb625991/dep-lib-postgres -L /Users/bastian/projects/rust-test/target/deps -L /Users/bastian/projects/rust-test/target/deps --extern phf_mac=/Users/bastian/projects/rust-test/target/deps/libphf_mac-78b8694be35c3487.dylib --extern openssl=/Users/bastian/projects/rust-test/target/deps/libopenssl-fbe75530f7eda428.rlib --extern phf=/Users/bastian/projects/rust-test/target/deps/libphf-4fc01267f85abb4e.rlib`
src/error.rs:23:68: 27:21 error: failed to resolve. Maybe a missing `extern crate /// was successful or not. An error will only be returned if the driver was`?
src/error.rs:23         static STATE_MAP: PhfMap<&'static str, PostgresSqlState> = phf_map!(
src/error.rs:24             $($code => $error),+
src/error.rs:25         );
src/error.rs:26
src/error.rs:27         impl PostgresSqlState {
src/lib.rs:1:1: 1779:1 note: in expansion of phf_map!
src/error.rs:23:68: 25:11 note: expansion site
src/error.rs:13:1: 37:2 note: in expansion of make_errors!
src/error.rs:40:1: 356:2 note: expansion site
src/error.rs:23:68: 25:11 error: `/// was successful or not. An error will only be returned if the driver was::/// unable to connect to the database.` does not name a structure
src/error.rs:23         static STATE_MAP: PhfMap<&'static str, PostgresSqlState> = phf_map!(
src/error.rs:24             $($code => $error),+
src/error.rs:25         );
src/lib.rs:1:1: 1779:1 note: in expansion of phf_map!
src/error.rs:23:68: 25:11 note: expansion site
src/error.rs:13:1: 37:2 note: in expansion of make_errors!
src/error.rs:40:1: 356:2 note: expansion site
error: aborting due to 2 previous errors
Could not compile `postgres`.

Caused by:
  Process didn't exit successfully: `rustc src/lib.rs --crate-name postgres --crate-type lib -g -C metadata=1731918feb625991 -C extra-filename=-1731918feb625991 --out-dir /Users/bastian/projects/rust-test/target/deps --dep-info /Users/bastian/projects/rust-test/target/.fingerprint/postgres-1731918feb625991/dep-lib-postgres -L /Users/bastian/projects/rust-test/target/deps -L /Users/bastian/projects/rust-test/target/deps --extern phf_mac=/Users/bastian/projects/rust-test/target/deps/libphf_mac-78b8694be35c3487.dylib --extern openssl=/Users/bastian/projects/rust-test/target/deps/libopenssl-fbe75530f7eda428.rlib --extern phf=/Users/bastian/projects/rust-test/target/deps/libphf-4fc01267f85abb4e.rlib -Awarnings` (status=101)

Rustc is the latest HEAD:

$ rustc --version
rustc 0.12.0-dev
@sfackler
Copy link
Owner

I'm guessing you installed Rust through homebrew? Doing that causes some sadness: rust-lang/rust#17289. I'd recommend using the nightly installers from rust-lang.org, which also allow you to avoid the long build times.

@turbolent
Copy link
Author

Yeah, I used homebrew. Just installed the nightly binaries and everything just works fine. Thanks for the quick help!

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