7

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"

<p>contract MainContract {}</p>
q9f
  • 32,913
  • 47
  • 156
  • 395
Walt D
  • 391
  • 2
  • 9

3 Answers3

4

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.

arodriguezdonaire
  • 3,027
  • 3
  • 20
  • 37
4

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.

Walt D
  • 391
  • 2
  • 9
0

Try adding .sol

import "someLib"

should be

import "someLib.sol"

see this issue for reference

euri10
  • 4,640
  • 5
  • 24
  • 55
moto5
  • 19
  • 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 Apr 09 '16 at 19:22
  • tried that, fully qualified, ... every permutation I could think of. – Walt D Apr 11 '16 at 12:07