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

Question: Importing the Library #4

Open
360disrupt opened this issue Oct 20, 2016 · 4 comments
Open

Question: Importing the Library #4

360disrupt opened this issue Oct 20, 2016 · 4 comments

Comments

@360disrupt
Copy link

360disrupt commented Oct 20, 2016

I try to import it like in the Readme

import "github.com/Arachnid/solidity-stringutils/strings.sol";

contract Mortal {
   ...

But when I try to build it with truffle I get this:

Cannot find import strings.sol from Test.sol. If it's a relative path, ensure it starts with `./` or `../`.
Compilation failed. See above.

How to do import it?

I read something here, that the compiler reads during dev from /usr/local/dapp-bin/library
http://ethereum.stackexchange.com/questions/2137/how-should-we-set-a-import-path-in-solidity
So do I need to download the repo into that folder?

@Arachnid
Copy link
Owner

How are you compiling this? github imports work fine in browser solidity, but if you're compiling from the command line, you should download the library and put it somewhere the compiler can reach, updating the import path to match.

@360disrupt
Copy link
Author

Thx, I do compile it from the command line. So I probably need to check out if I configure a libraries directory in truffle?

@Arachnid
Copy link
Owner

Yes, whatever library support your framework has; putting it in the same directory will almost certainly work too.

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

No branches or pull requests

3 participants
@Arachnid @360disrupt and others