I'm trying to compile any smart contract. Let's say the skeleton one. When running eosiocpp -o it can't find the header file for eosio. Not a duplicate of Can not find <eosiolib/eosio.hpp> when compiling with eosiocpp because changing to 16.04 didn't work for me. Experienced this issue on both 18.04 and 16.04.

Also as you can see the programs haven't installed properly so I have to run the executables from where they were built.

cd $EOS_ROOT/build; sudo make install; cd contracts; sudo ./../tools/eosiocpp -n hello2; sudo ./../tools/eosiocpp -o hello2/hello2.wast hello2/hello2.cpp

yields

hello2/hello2.cpp:1:10: fatal error: 'eosiolib/eosio.hpp' file not found
#include <eosiolib/eosio.hpp>
     ^~~~~~~~~~~~~~~~~~~~
1 error generated.

Any ideas?

  • Same here with MAC OS 10.12.6 and EOS version 1.1.3. – Roman Frolov Aug 9 at 7:19
up vote 5 down vote accepted

If you used sudo make install, then you should use the eosiocpp binaries generated for you. In the latest version, I believe they shoud be in /usr/local/eosio/bin/ (it should print this info when sudo make install is finished if it's a different path) so add that to your $PATH:

$ export PATH=/usr/local/eosio/bin/:$PATH
$ which eosiocpp
/usr/bin/eosio/bin/eosiocpp
$ eosiocpp -n hello
$ eosiocpp -o hello/hello.wasm hello/hello.cpp

This is a known issue for eosiocpp in version 1.1.2/1.1.3 of the eosio/eos Github repo. Switching to version 1.1.0 solved the problem for me and a colleague.

Here's a host of issues relating to the problem:

  • Can you link us to the Github issue number? – Phillip Hamnett - EOS42 Aug 7 at 18:17
  • Switching to 1.1.0 solved issue for me. Hope this issue will be fixed in a new patch. – Roman Frolov Aug 9 at 11:29

As a workaround, revert locally the commit which introduced a regression, then build and install again:

cd $HOME/eos
git revert -n 67393d7
./eosio_build.sh
cd build
sudo make install

eosiocpp should work now fine.

Full details within:

https://github.com/EOSIO/eos/issues/5133

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.