Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/main.rs not applicable? #91

Open
overheat opened this issue Feb 22, 2023 · 1 comment
Open

src/main.rs not applicable? #91

overheat opened this issue Feb 22, 2023 · 1 comment

Comments

@overheat
Copy link

I got this error:

$cargo call-stack > cg.dot

error: Please specify either --example <NAME> or --bin <NAME>.
@japaric
Copy link
Owner

japaric commented Feb 27, 2023

you need to specify the name of the crate even if the Cargo package contains only a single binary crate in it. the crate with root at src/main.rs has the same name as the Cargo package (this is specified in the package's Cargo.toml).

so for a project created with cargo new --bin hello you would have to use cargo call-stack --bin hello --target x86_64-unknown-linux-gnu. note that the --target flag is required if you have not set a compilation target in .cargo/config.toml (yes, even if you are doing native compilation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants