10 Solana执行anchor test,显示找不到target/deploy/helloworld.so文件

本地环境 rustc 1.77.0-nightly (5d3d3479d 2024-01-23) anchor-cli 0.29.0 solana-cli 1.17.5 (src:7089f1ed; feat:3011420684, client:SolanaLabs)

anchor build可以成功,但是编译后文件只有target/deploy/helloworld-keypair.json,没有target/deploy/helloworld.so文件

anchor test

Deploying cluster: http://localhost:8899
Upgrade authority: /Users/xp/.config/solana/id.json
Deploying program "helloworld"...
Program path: /Users/xp/workshop_01/demos/helloworld/target/deploy/helloworld.so...
Error: Unable to open program file: No such file or directory (os error 2)
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
请先 登录 后评论

最佳答案 2024-02-29 22:04

执行 cargo build-bpf --manifest-path=./Cargo.toml --bpf-out-dir=target/deploy 可以成功编译出.so文件

请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,1500 浏览
  • Ethereal 提出于 2024-01-24 13:39