Working in the MIX environment, I'd like to try using a libraries and contracts defined in different files. However, the main contract always gets an error from MIX, no matter how I define the "import". The error is:

C:/TryImport/MainContract.sol Error: Source not found: File not supplied initially.

If I move the library into the contract file as a test, it compiles and works.

File someLib.sol

library someLib {...}

File MainContract.sol

import "someLib"

contract MainContract {}

  • Congratulations for asking the 1000th question on Ethereum Stack Exchange :-)
    – q9f
    Commented Apr 4, 2016 at 21:06

3 Answers 3


You can't import Truffle libraries to any contract in Mix. The thing is that Truffle use your imports to build an only .sol file, so the compiler doesn't import anything. If you want to debug your imports in Mix you should copy your libraries code in the same file than your other contracts.

  • 1
    Solidity supports imports (or so I thought), and that is what I'm asking about. Not Truffle imports (which btw it is discontinuing due to Solidity now supporting imports).
    – Walt D
    Commented Apr 6, 2016 at 20:43
  • Where do you found it? Commented Apr 6, 2016 at 20:46

So it turns out there is an issue in the current release...they have been notified.

The work around is to use the full path. I also didn't realize that the full path is case sensitive.


Try adding .sol

import "someLib"

should be

import "someLib.sol"

see this issue for reference

  • 1
    Hi and welcome to Ethereum Stack Exchange! Are you sure this will work? Did you test that? Maybe you could add some explaination to your answer and tell why this is required.
    – q9f
    Commented Apr 9, 2016 at 19:22
  • tried that, fully qualified, ... every permutation I could think of.
    – Walt D
    Commented Apr 11, 2016 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.