Skip to content

fail to import the sol in parent path #4914

@ayeteng

Description

@ayeteng

Description

import sol file doesn't work with parent path set.
example:

solc --abi --bin --overwrite n1.sol -o /Users/sam/work/car/contracts/storage/compiled
n1.sol:4:1: Error: Source "CMEnabled.sol" not found: File not found.
import "../CMEnabled.sol";

but if I change the import path to ./ and add the file in the same path.

solc --abi --bin --overwrite CMCEnabled.sol -o /Users/samteng/work/car/contracts/compiled

import "./CMEnabled.sol";

Environment

  • Compiler version:

solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Darwin.appleclang

  • Operating system:
    OSX 10.13.6

Steps to Reproduce

solc --abi --bin --overwrite n1.sol -o /Users/sam/work/car/contracts/storage/compiled
n1.sol:4:1: Error: Source "CMEnabled.sol" not found: File not found.
import "../CMEnabled.sol";

Please provide a minimal source code example to trigger the bug you have found.
Please also mention any command line flags that are necessary for triggering the bug.
Provide as much information as necessary to reproduce the bug.

pragma solidity ^0.4.24;

import "./utility.sol";
import "../CMEnabled.sol";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions