I'm using Geth 1.4.5-stable along with Solc version 0.3.5-0 both on Linux. It is run on a Digital Ocean server. I have a fully synced testnet chain and I'm trying to compile contracts from within the Javascript console.
Steps I've taken:
A. I added Solidity to PATH with export PATH=$PATH:/usr/bin/solc
B. I connected to the console in an another shell window with the following command:
geth --rpc --rpcaddr localhost --rpcapi "eth,net,web3,admin" \
--solc /usr/bin/solc attach ipc:/home/physes/.ethereum/testnet/geth.ipc
This seems to work fine, and I can use other RPI API commands.
C. I was testing out a Greeter contract.
i)
var greeterSource = 'contract mortal { address owner; function mortal() { owner = msg.sender; } function kill() { if (msg.sender == owner) suicide(owner); } } contract greeter is mortal { string greeting; function greeter(string _greeting) public { greeting = _greeting; } function greet() constant returns (string) { return greeting; } }'
ii)
var greeterCompiled = web3.eth.compile.solidity(greeterSource)
At this point it fails, and I get:
solc: exit status 1
Unknown exception during compilation.
at web3.js:3119:20
at web3.js:6023:15
at web3.js:4995:36
at <anonymous>:1:23
What am I doing wrong?
solc
and it is working.