When I use the --abi option, the abi interface is generated:

$ solc Greeter.sol --abi

======= Greeter.sol:mortal =======
Contract JSON ABI

But when I ask it to put it into the output folder, with -o build, the file is missing:

WHHA@NBVAL752 ~/dev/java-magazine-tutorial
$ solc Greeter.sol --abi -o build

WHHA@NBVAL752 ~/dev/java-magazine-tutorial
$ ls build/

WHHA@NBVAL752 ~/dev/java-magazine-tutorial
$ cat build/Greeter.sol

The only generated file is Greeter.sol which is emtpy.

The contract code is:

$ less Greeter.sol pragma solidity ^0.4.2;

contract mortal {  /* Define variable owner of the type address*/  address owner;  /* this function is executed at initialization  and sets the owner of the contract */ function mortal() { owner = msg.sender; }

/* Function to recover the funds on the  contract */  function kill() {  if (msg.sender == owner) suicide(owner);  } } Greeter.sol (END)

SOlc version is:

$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.9+commit.364da425.Windows.msvc

Any idea??


2 Answers 2


It seems like a command syntax issue. This works for me:

solc --abi greeter.sol -o build


For generating abi and bin files using solc

solc --abi --bin --optimize Calculator.sol -o contracts

Please note i executed this code from my root folder where this .sol file is present.

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.