Import Resolution Failures
E4003: Unresolved Import
error[E4003]: unresolved import 'libraries/Storage.sol'
--> MyContract.sol:3:1
|
3 | import "libraries/Storage.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: pass the devpack root with -I: neo-solc MyContract.sol -I devpackCause: The compiler cannot find the imported file relative to any include path.
Solutions:
Pass the devpack root as an include path:
bashneo-solc MyContract.sol -I devpack -o build/MyContractVerify the import path matches the devpack directory structure:
devpack/ ├── contracts/ → import "contracts/NativeCalls.sol" ├── libraries/ → import "libraries/Storage.sol" └── standards/ → import "standards/NEP17.sol"For multiple include paths, pass
-Imultiple times:bashneo-solc MyContract.sol -I devpack -I ./my-libs -o build/MyContract
TIP
Import paths are resolved relative to each -I directory in order. The compiler does not use Solidity remappings or package managers.
