1

experiencing error: linking with cc failed: exit status: 1, when I am running ProgramTestContext , like I want to createATAinstruction so that I should have the data in the ata that shows it exists that is why I am using this

    use spl_associated_token_account::get_associated_token_address;

but I am unable to do in my test cases of rust, need help.

1 Answer 1

0

There's not enough information provided in the question, but I'm guessing that you're declaring a dependency on spl-associated-token-account like this in your Cargo.toml:

spl-associated-token-account = "VERSION_STRING"

This means that your program likely has two separate entrypoints defined, which causes build errors. To get around that, you should import the ATA crate with the no-entrypoint feature, ie:

spl-associated-token-account = { version = "VERSION_STRING", features = ["no-entrypoint"] }

Separately, there's a new much lighter client crate which just has the instruction creators and address derivation functions: https://crates.io/crates/spl-associated-token-account-client

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.