Eos: Missing reference to eoslib creating error in eoscpp WAST file generation from hello world source

Created on 8 Jan 2018  路  10Comments  路  Source: EOSIO/eos

Hi, I'm following the instructions here and have used eoscpp to create the hello world contract in my eos/contracts folder. When I attempt to run the following from eos/contracts/hello I receive this error:

```
eoscpp -o hello.wast hello.cpp
/usr/local/wasm/bin/clang -emit-llvm -O3 --std=c++14 --target=wasm32 -ffreestanding -nostdlib -fno-threadsafe-statics -fno-rtti -fno-exceptions -I /usr/local/include -I . -c hello.cpp -o /var/folders/1p/kc0d5nz90nn7d72_pzm4jwrc0000gn/T/tmp.rOWhcSlA/built/hello.cpp
In file included from hello.cpp:5:
./hello.hpp:5:10: fatal error: 'eoslib/eos.hpp' file not found

include

     ^~~~~~~~~~~~~~~~

1 error generated.
````

OS is MacOS High Sierra 10.13.2. Pulled down 2cc40a4 before attempting this.

I followed the setup instructions to a tee and have successfully built the project though (although this relates to the attached tool eoscpp I thought it worth mentioning)

needs testing - pass

Most helpful comment

OS: Ubuntu 16.14
the EOSIO was installed in the root
Time: Jan.19 2018

Thanks @horyd

I also got these two errors, and the solutions are nearly same.

1st error same as @horyd

take care the bold code:

_eoscpp -o hello.wast hello.cpp
/usr/local/wasm/bin/clang -emit-llvm -O3 --std=c++14 --target=wasm32 -ffreestanding -nostdlib -fno-threadsafe-statics -fno-rtti -fno-exceptions -I /usr/local/include -I . -c hello.cpp -o /var/folders/1p/kc0d5nz90nn7d72_pzm4jwrc0000gn/T/tmp.rOWhcSlA/built/hello.cpp
In file included from hello.cpp:5:
./hello.hpp:5:10: fatal error: 'eoslib/eos.hpp' file not found

include

     ^~~~~~~~~~~~~~~~

1 error generated._

the solution as below:

cd eos
mkdir include
cp -rf /contrats/eoslib /eos/include/

2nd error same as @denkomanceski

/usr/local/share/skeleton/.: No such file

refer to #1006

the solution as below:

/usr/local/share directory. This is done with the following commands:
cd /eos/contracts
cp -rf ./skeleton /usr/local/share

All 10 comments

More information, the ${EOSIO_INSTALL_DIR} from the eoscpp.in file is usr/local, but the eoslib is not located in usr/local/include which looks like where it's looking for it. I wrote in an absolute reference into eoscpp.in and recompiled it, and it now works. I'm assuming there's an installation step missing (or I've missed one?) that puts those files where they need to be?

Found solution: after building, cd build then sudo make install. Thanks to @elmato on Telegram for that :)

That step appears to be missing in the docs though?

I had similar issue:
image

sudo make install worked for me as well

tnx @horyd

Edit: Maybe this has something to do with using Incremental build instead of Full ?

OS: Ubuntu 16.14
the EOSIO was installed in the root
Time: Jan.19 2018

Thanks @horyd

I also got these two errors, and the solutions are nearly same.

1st error same as @horyd

take care the bold code:

_eoscpp -o hello.wast hello.cpp
/usr/local/wasm/bin/clang -emit-llvm -O3 --std=c++14 --target=wasm32 -ffreestanding -nostdlib -fno-threadsafe-statics -fno-rtti -fno-exceptions -I /usr/local/include -I . -c hello.cpp -o /var/folders/1p/kc0d5nz90nn7d72_pzm4jwrc0000gn/T/tmp.rOWhcSlA/built/hello.cpp
In file included from hello.cpp:5:
./hello.hpp:5:10: fatal error: 'eoslib/eos.hpp' file not found

include

     ^~~~~~~~~~~~~~~~

1 error generated._

the solution as below:

cd eos
mkdir include
cp -rf /contrats/eoslib /eos/include/

2nd error same as @denkomanceski

/usr/local/share/skeleton/.: No such file

refer to #1006

the solution as below:

/usr/local/share directory. This is done with the following commands:
cd /eos/contracts
cp -rf ./skeleton /usr/local/share

A comment has been added to #build.sh #912 but it still needs to be executed manually inside 'build' directory like @horyd and @denkomanceski mentioned ;)

Would there be any danger to sudo ln -s /path/to/eos/build/install/share/skeleton /usr/local/share/skeleton? I am fairly new and just arrived to that fix, but I feel like it is incorrect.

@horyd that's the only thing that worked for me, Eoscpp.in uses the CMAKE path for eosio_install_dir and that sticks regardless (install goes under build but E-I-D and Eoscpp I parameters are still going to /usr/local/include). I tried running sudo make install etc..
After hardcoding the path all is fine.

More information, the ${EOSIO_INSTALL_DIR} from the eoscpp.in file is usr/local, but the eoslib is not located in usr/local/include which looks like where it's looking for it. I wrote in an absolute reference into eoscpp.in and recompiled it, and it now works. I'm assuming there's an installation step missing (or I've missed one?) that puts those files where they need to be?

I'm having this same issue with DAWN-2018-01-25 on MacOs 10.13.3

Please follow the new hello world tutorial located here: https://github.com/EOSIO/eos/wiki/Tutorial-Getting-Started-With-Contracts

hi
I found the name "eoslib" had been changed to "eosiolib", does the wiki need to change also ?
https://github.com/EOSIO/eos/wiki/Smart%20Contract

include

include

Was this page helpful?
0 / 5 - 0 ratings