How can I use the 'num' crate in my

I'm trying to use the 'num' crate in my So following the instructions on the 'num' crate page I have this in my Cargo.toml:

num = "0.2"

And this in my

extern crate num;

The 'num' crate gets downloaded and compiled. However cargo then complains:

error[E0463]: can't find crate for `num`
5 | extern crate num;
  | ^^^^^^^^^^^^^^^^^ can't find crate

Which I find odd as I know this works from a regular main().

What to do?

1 Like

Build dependencies need to go in a seperate section of your Cargo.toml:


Thanks. That fixed it.

Like many things Rust, it's all clear when you can find it.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.