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

compilation failed with symbol multiply defined! failed to load bitcode of module "program nane-xxx" #3314

Closed
SpringChiu opened this issue Oct 16, 2024 · 2 comments
Labels

Comments

@SpringChiu
Copy link

when I import solana anchor program's instruction, compilation failed with error info:
those are my code:

use solana_vault::instruction as solana_vault_instruction;

those are error info:

warning: Linking globals named 'entrypoint': symbol multiply defined!

error: failed to load bitcode of module "solana_vault-91162013c3821f80.solana_vault.c7fe4af8e94c9c31-cgu.0.rcgu.o":
@acheroncrypto
Copy link
Collaborator

You can fix this by enabling either the cpi or the no-entrypoint feature of the external program crate you're using. For example:

[dependencies]
solana-vault = { version = "0.1.0", features = ["cpi"] }

You can also avoid adding programs for CPI as a dependency by using declare_program!.

@SpringChiu
Copy link
Author

You can fix this by enabling either the cpi or the no-entrypoint feature of the external program crate you're using. For example:

[dependencies]
solana-vault = { version = "0.1.0", features = ["cpi"] }

You can also avoid adding programs for CPI as a dependency by using declare_program!.

Thanks! I add feature of no-entrypoint and it compiled success

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

No branches or pull requests

2 participants