4

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?

1
  • Same here with MAC OS 10.12.6 and EOS version 1.1.3. Commented Aug 9, 2018 at 7:19

3 Answers 3

5

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
2

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:

2
  • Can you link us to the Github issue number? Commented Aug 7, 2018 at 18:17
  • Switching to 1.1.0 solved issue for me. Hope this issue will be fixed in a new patch. Commented Aug 9, 2018 at 11:29
1

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 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.