8

I am getting the following error from solc:

Error: Source file requires different compiler version (current compiler is 0.4.11-develop.2017.6.22+commit.68ef5810.Darwin.appleclang - note that nightly builds are considered to be strictly less than the released version
pragma solidity 0.4.11;
^---------------------^

In order to build solc, I:

  1. cloned the solidity repository,
  2. ran git checkout v0.4.11 which successfully got the tag/v0.4.11. 3. completed the build process
  3. made sure solc was in my path

    solc --version
    solc, the solidity compiler commandline interface
    Version: 0.4.11-develop.2017.6.22+commit.68ef5810.Darwin.appleclang
    

So, that is the v0.4.11 release, but the version number has today's date in it. Is that the source of the error?

System is macOS Sierra 10.12.5.

3 Answers 3

6

I solved my problem by RTFM. Mac users should install using Homebrew.

From Installing Solidity

brew update 
brew upgrade
brew tap ethereum/ethereum
brew install solidity
brew linkapps solidity

If you need a specific version of Solidity you can install a Homebrew formula directly from Github.

2
  • 2
    for ubuntu: sudo npm install -g solc Nov 7, 2017 at 19:11
  • 1
    You can probably accept your own answer then :)
    – asymmetric
    Nov 13, 2018 at 19:11
2

To Install specific version of solidity, use :

npm install -g [email protected]

This will install solidity compiler 0.4.26 (latest on that version), globally.

or

npm install -g [email protected]

Then

$ solcjs --version
> 0.4.26+commit.4563c3fc.Emscripten.clang
2
1

This works for me:

brew tap ethereum/ethereum
brew extract --version=0.8.17 solidity ethereum/ethereum
brew install [email protected]

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.