0
votes

The error

error[E0432]: unresolved import `clap`
 --> src/main.rs:1:5
  |
1 | use clap;
  |     ^^^^ no external crate `clap`

The code I an using

use clap;
use regex;

Cargo.toml

[dependencies]
clap-v3 = "3.0.0-beta.1"
regex = "1.4.5"

I have tried using

extern crate clap; 

error[E0463]: can't find crate for `clap`
 --> src/main.rs:1:1
  |
1 | extern crate clap;
  | ^^^^^^^^^^^^^^^^^^ can't find crate

Is there something I am missing ?

1

1 Answers

2
votes

In the dependencies section you are specifying clap-v3 as a dependency which you need to use like use clap_v3; in your code. Maybe you wanted to add clap (without -v3) as a dependency. It has a release with the same version number.