[RESOLVE] Issue with rand

Hi,
(sorry for my bad english ;P)
I just started rust this morning.

I don't find the probleme. If i can copy/paste the code in book, i have the same error.

here the code

The compiling error is :

src\main.rs:11:25: 11:41 error: unresolved name `rand::thread_rng`
src\main.rs:11     let nombre_secret = rand::thread_rng().gen_range(1, 100);

You are missing extern crate rand; at the top.

1 Like

Uups! Just missing to paste it :stuck_out_tongue:

Edited.

Did you add the rand crate as a dependency in your Cargo.toml file? Tutorial: Guessing Game

1 Like

Aah...
Nop.

Thank's <3

1 Like