1

I am getting this error this struct takes 0 lifetime arguments but 1 lifetime argument was supplied when trying to use the solana-sdk = { version = "1.16.9" } crate.

For my CLI environment, I am using version 1.16.9

Below are the full logs

Error: Function _ZN209_$LT$curve25519_dalek..window..NafLookupTable8$LT$curve25519_dalek..backend..serial..curve_models..ProjectiveNielsPoint$GT$$u20$as$u20$core..convert..From$LT$$RF$curve25519_dalek..edwards..EdwardsPoint$GT$$GT$4from17h1c13beefdabbe951E Stack offset of 11000 exceeded max offset of 4096 by 6904 bytes, please minimize large stack variables
Error: Function _ZN205_$LT$curve25519_dalek..window..NafLookupTable8$LT$curve25519_dalek..backend..serial..curve_models..AffineNielsPoint$GT$$u20$as$u20$core..convert..From$LT$$RF$curve25519_dalek..edwards..EdwardsPoint$GT$$GT$4from17hb3939ff33104a56cE Stack offset of 8352 exceeded max offset of 4096 by 4256 bytes, please minimize large stack variables
Error: Function _ZN116_$LT$curve25519_dalek..edwards..EdwardsBasepointTableRadix16$u20$as$u20$curve25519_dalek..traits..BasepointTable$GT$6create17h4999f75273e46a70E Stack offset of 30896 exceeded max offset of 4096 by 26800 bytes, please minimize large stack variables
Error: Function _ZN116_$LT$curve25519_dalek..edwards..EdwardsBasepointTableRadix32$u20$as$u20$curve25519_dalek..traits..BasepointTable$GT$6create17h5eae7f13544a0a72E Stack offset of 62896 exceeded max offset of 4096 by 58800 bytes, please minimize large stack variables
Error: Function _ZN116_$LT$curve25519_dalek..edwards..EdwardsBasepointTableRadix64$u20$as$u20$curve25519_dalek..traits..BasepointTable$GT$6create17h55f24b3221f81e35E Stack offset of 113944 exceeded max offset of 4096 by 109848 bytes, please minimize large stack variables
Error: Function _ZN117_$LT$curve25519_dalek..edwards..EdwardsBasepointTableRadix128$u20$as$u20$curve25519_dalek..traits..BasepointTable$GT$6create17he4aaab1650e2dde2E Stack offset of 227864 exceeded max offset of 4096 by 223768 bytes, please minimize large stack variables
Error: Function _ZN117_$LT$curve25519_dalek..edwards..EdwardsBasepointTableRadix256$u20$as$u20$curve25519_dalek..traits..BasepointTable$GT$6create17he5f6f153e4c2c787E Stack offset of 506896 exceeded max offset of 4096 by 502800 bytes, please minimize large stack variables
Error: Function _ZN212_$LT$curve25519_dalek..window..LookupTableRadix64$LT$curve25519_dalek..backend..serial..curve_models..ProjectiveNielsPoint$GT$$u20$as$u20$core..convert..From$LT$$RF$curve25519_dalek..edwards..EdwardsPoint$GT$$GT$4from17he042683c35faf1a9E Stack offset of 5648 exceeded max offset of 4096 by 1552 bytes, please minimize large stack variables
Error: Function _ZN208_$LT$curve25519_dalek..window..LookupTableRadix64$LT$curve25519_dalek..backend..serial..curve_models..AffineNielsPoint$GT$$u20$as$u20$core..convert..From$LT$$RF$curve25519_dalek..edwards..EdwardsPoint$GT$$GT$4from17hc75e92a98b7ef494E Stack offset of 4360 exceeded max offset of 4096 by 264 bytes, please minimize large stack variables
Error: Function _ZN213_$LT$curve25519_dalek..window..LookupTableRadix128$LT$curve25519_dalek..backend..serial..curve_models..ProjectiveNielsPoint$GT$$u20$as$u20$core..convert..From$LT$$RF$curve25519_dalek..edwards..EdwardsPoint$GT$$GT$4from17h8141b40b221d8f47E Stack offset of 10768 exceeded max offset of 4096 by 6672 bytes, please minimize large stack variables
Error: Function _ZN209_$LT$curve25519_dalek..window..LookupTableRadix128$LT$curve25519_dalek..backend..serial..curve_models..AffineNielsPoint$GT$$u20$as$u20$core..convert..From$LT$$RF$curve25519_dalek..edwards..EdwardsPoint$GT$$GT$4from17h73ea8ff8b5f63411E Stack offset of 8200 exceeded max offset of 4096 by 4104 bytes, please minimize large stack variables
Error: Function _ZN213_$LT$curve25519_dalek..window..LookupTableRadix256$LT$curve25519_dalek..backend..serial..curve_models..ProjectiveNielsPoint$GT$$u20$as$u20$core..convert..From$LT$$RF$curve25519_dalek..edwards..EdwardsPoint$GT$$GT$4from17hb1cb5bdd4558d796E Stack offset of 21008 exceeded max offset of 4096 by 16912 bytes, please minimize large stack variables
Error: Function _ZN209_$LT$curve25519_dalek..window..LookupTableRadix256$LT$curve25519_dalek..backend..serial..curve_models..AffineNielsPoint$GT$$u20$as$u20$core..convert..From$LT$$RF$curve25519_dalek..edwards..EdwardsPoint$GT$$GT$4from17h14d024fb35937fe6E Stack offset of 15880 exceeded max offset of 4096 by 11784 bytes, please minimize large stack variables
   Compiling termcolor v1.2.0
   Compiling atty v0.2.14
   Compiling serde_with v2.3.3
   Compiling anchor-derive-space v0.28.0
error[E0425]: cannot find function `is` in this scope
  --> src/lib.rs:98:6
   |
98 |     !is(stream)
   |      ^^ not found in this scope

error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
   --> src/lib.rs:418:20
    |
418 |     StdoutLock(io::StdoutLock<'a>),
    |                    ^^^^^^^^^^---- help: remove these generics
    |                    |
    |                    expected 0 lifetime arguments

error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
   --> src/lib.rs:419:20
    |
419 |     StderrLock(io::StderrLock<'a>),
    |                    ^^^^^^^^^^---- help: remove these generics
    |                    |
    |                    expected 0 lifetime arguments

For more information about this error, try `rustc --explain E0425`.
For more information about this error, try `rustc --explain E0107`.
error: could not compile `termcolor` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `atty` due to previous error

1 Answer 1

3

You're probably trying to use solana-sdk in an on-chain program. solana-sdk contains many things that are not available to on-chain programs, such as randomness, private keys, etc.

You must use the solana-program crate in your on-chain program and remove solana-sdk. You can use it in tests as a dev-dependency though

2
  • I want to sign a TX on the on-chain program and send it. Is this possible with the solana-sdk?
    – Jimii
    Commented Aug 30, 2023 at 11:13
  • 2
    That's not possible to do at all. While on-chain, you can do a cross-program invocation into another program, however, where you send one instruction to another program. Note that you can only invoke programs that were passed to your program. docs.solana.com/developing/programming-model/… for more info
    – Jon C
    Commented Aug 30, 2023 at 17:37

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.