6

I've tried to run the example under "Configuring the Parser" and get some errors. What could be my problem?

Errors

  • error: cannot find derive macro Parser in this scope
  • error: cannot find attribute command in this scope
  • error: cannot find attribute arg in this scope
  • error[E0599]: no function or associated item named parse found for struct Cli in the current scope

Cargo.toml

[package]
name = "hello_cargo"
version = "0.1.0"
edition = "2021"

[dependencies]
clap = "4.3.5"
you are viewing a single comment's thread
view the rest of the comments
[-] epage@kbin.social 4 points 3 years ago

The tutorial makes a reference to this

This requires enabling the derive feature flag.

But if you aren't as familiar with feature flags, this isn't as helpful.

More specifically on the front page we have

$ cargo add clap --features derive

Maybe we should push that down into the tutorial...

this post was submitted on 22 Jun 2023
6 points (100.0% liked)

Rust

8256 readers
29 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 3 years ago
MODERATORS