While testing the token-counter example from the Solana Developer Program, the build fails with the following error:
error[E0433]: failed to resolve: use of undeclared crate or module solana_program
This occurs after updating to Solana CLI v1.18.x and Anchor v0.30.x.
Steps to Reproduce:
- Clone the repository
git clone https://github.com/solana-developers/program-examples.git cd program-examples/token-counter
- Build and deploy the program
anchor build anchor deploy
- Observe the error output above.
Expected Behaviour:
The example should compile and deploy successfully without modification.
Actual Behaviour:
The build fails due to an unresolved dependency or outdated import path.
Environment:
- OS: macOS 14.5 / Ubuntu 22.04
- Solana CLI: v1.18.3
- Anchor: v0.30.1
- Rust: 1.81.0