Cargo build issue - please recompile that crate using --crate-type lib

(Please excuse me if this is duplicate. I just submitted this and it did not take!)

I'm getting a build error I have not seen trying to follow a postgres example I found. Example.

Here's my Cargo.toml:

[package]
name = "day11"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
postgres = "0.19.2"
postgres_macros = "0.1.13"
rustc-serialize = "0.3.24"
time = "0.3.3"
postgres_array = "0.11.0"

And here is my build error error:

$ cargo build
    Updating crates.io index
   Compiling postgres_macros v0.1.13
error[E0462]: found staticlib `rustc` instead of rlib or dylib
 --> /home/chris/.cargo/registry/src/github.com-1ecc6299db9ec823/postgres_macros-0.1.13/src/lib.rs:4:1
  |
4 | extern crate rustc;
  | ^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using --crate-type lib
  = note: the following crate versions were found:
          crate `rustc`: /home/chris/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-stable_rt.asan.a
          crate `rustc`: /home/chris/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-stable_rt.tsan.a
          crate `rustc`: /home/chris/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-stable_rt.lsan.a
          crate `rustc`: /home/chris/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-stable_rt.msan.a

error: could not compile `postgres_macros` due to previous error

Specifically, with respect to the help hint-- "please recompile that crate using --crate-type lib"
Does this seem to be the solution?
If so, how does one specify that a specific dependency be recompiled with --crate-type lib.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.