EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.28k stars 3.76k forks source link

eosiocpp wast file generation error #1439

Closed DThink closed 6 years ago

DThink commented 6 years ago

OS: ubuntu 16.04 lts 64 bit gcc, g++ version: 7.2.0 other installed package is the same that i read in the installation guide


hello, after the generation of a simple contract skeleton when i try to compiled the cpp file i receive different errors.

./eosiocpp -o '/home/nessuno/eos/build/tools/hello/hello.wast' '/home/nessuno/eos/build/tools/hello/hello.cpp'

/home/nessuno/opt/wasm/bin/clang -emit-llvm -O3 --std=c++14 --target=wasm32 -ffreestanding -nostdlib -fno-threadsafe-statics -fno-rtti -fno-exceptions -I /home/nessuno/eos/build/install/include -I /home/nessuno/eos/build/tools/hello -c /home/nessuno/eos/build/tools/hello/hello.cpp -o /tmp/tmp.0tkMIenFLm/built/hello.cpp In file included from /home/nessuno/eos/build/tools/hello/hello.cpp:5: In file included from /home/nessuno/eos/build/tools/hello/hello.hpp:5: In file included from /home/nessuno/eos/build/install/include/eosiolib/eosio.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/action.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/datastream.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/vector.hpp:2: In file included from /home/nessuno/eos/build/install/include/eosiolib/memory.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/print.hpp:6: /home/nessuno/eos/build/install/include/eosiolib/print.h:74:26: error: unknown type name 'uint128_t' void printi128( const uint128_t value ); ^ In file included from /home/nessuno/eos/build/tools/hello/hello.cpp:5: In file included from /home/nessuno/eos/build/tools/hello/hello.hpp:5: In file included from /home/nessuno/eos/build/install/include/eosiolib/eosio.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/action.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/datastream.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/vector.hpp:2: In file included from /home/nessuno/eos/build/install/include/eosiolib/memory.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/print.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/math.hpp:6: /home/nessuno/eos/build/install/include/eosiolib/math.h:32:21: error: unknown type name 'uint128_t' void multeq_i128( uint128_t self, const uint128_t other ); ^ /home/nessuno/eos/build/install/include/eosiolib/math.h:32:44: error: unknown type name 'uint128_t' void multeq_i128( uint128_t self, const uint128_t other ); ^ /home/nessuno/eos/build/install/include/eosiolib/math.h:47:21: error: unknown type name 'uint128_t' void diveq_i128 ( uint128_t self, const uint128_t other ); ^ /home/nessuno/eos/build/install/include/eosiolib/math.h:47:44: error: unknown type name 'uint128_t' void diveq_i128 ( uint128_t self, const uint128_t* other ); ^ In file included from /home/nessuno/eos/build/tools/hello/hello.cpp:5: In file included from /home/nessuno/eos/build/tools/hello/hello.hpp:5: In file included from /home/nessuno/eos/build/install/include/eosiolib/eosio.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/action.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/datastream.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/vector.hpp:2: In file included from /home/nessuno/eos/build/install/include/eosiolib/memory.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/print.hpp:8: /home/nessuno/eos/build/install/include/eosiolib/math.hpp:39:23: error: unknown type name 'uint128_t' inline void multeq( uint128_t& self, const uint128_t& other ) { ^ /home/nessuno/eos/build/install/include/eosiolib/math.hpp:39:46: error: unknown type name 'uint128_t' inline void multeq( uint128_t& self, const uint128_t& other ) { ^ /home/nessuno/eos/build/install/include/eosiolib/math.hpp:59:22: error: unknown type name 'uint128_t' inline void diveq( uint128_t& self, const uint128_t& other ) { ^ /home/nessuno/eos/build/install/include/eosiolib/math.hpp:59:45: error: unknown type name 'uint128_t' inline void diveq( uint128_t& self, const uint128_t& other ) { ^ /home/nessuno/eos/build/install/include/eosiolib/math.hpp:68:18: error: unknown type name 'uint128_t' uint128( uint128_t i = 0 ):value(i){} ^ /home/nessuno/eos/build/install/include/eosiolib/math.hpp:86:38: error: unknown type name 'uint128_t'* uint128& operator = ( const uint128_t& other ) { ^ /home/nessuno/eos/build/install/include/eosiolib/math.hpp:95:38: error: unknown type name 'uint128_t' uint128& operator /= ( const uint128_t& other ) { ^ /home/nessuno/eos/build/install/include/eosiolib/math.hpp:110:9: error: unknown type name 'uint128_t' uint128_t value = 0; ^ In file included from /home/nessuno/eos/build/tools/hello/hello.cpp:5: In file included from /home/nessuno/eos/build/tools/hello/hello.hpp:5: In file included from /home/nessuno/eos/build/install/include/eosiolib/eosio.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/action.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/datastream.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/vector.hpp:2: In file included from /home/nessuno/eos/build/install/include/eosiolib/memory.hpp:8: /home/nessuno/eos/build/install/include/eosiolib/print.hpp:55:16: error: redefinition of 'print' inline void print( unsigned int num ) { ^ /home/nessuno/eos/build/install/include/eosiolib/print.hpp:37:16: note: previous definition is here inline void print( uint32_t num ) { ^ /home/nessuno/eos/build/install/include/eosiolib/print.hpp:65:18: error: use of undeclared identifier 'uint128_t' printi128((uint128_t*)&num); ^ /home/nessuno/eos/build/install/include/eosiolib/print.hpp:65:28: *error: expected expression printi128((uint128_t)&num); ^ /home/nessuno/eos/build/install/include/eosiolib/print.hpp:73:23: error: unknown type name 'uint128_t' inline void print( uint128_t num ) { ^ /home/nessuno/eos/build/install/include/eosiolib/print.hpp:74:18: error: use of undeclared identifier 'uint128_t' printi128((uint128_t)&num); ^ /home/nessuno/eos/build/install/include/eosiolib/print.hpp:74:28: error: expected expression printi128((uint128_t)&num); ^ In file included from /home/nessuno/eos/build/tools/hello/hello.cpp:5: In file included from /home/nessuno/eos/build/tools/hello/hello.hpp:5: In file included from /home/nessuno/eos/build/install/include/eosiolib/eosio.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/action.hpp:7: In file included from /home/nessuno/eos/build/install/include/eosiolib/datastream.hpp:8: In file included from /home/nessuno/eos/build/install/include/eosiolib/vector.hpp:3: /home/nessuno/eos/build/install/include/eosiolib/stdlib.hpp:3:10: fatal error: 'initializer_list' file not found

include

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

20 errors generated.

riotom commented 6 years ago

i have same problem

huanzhengzbt commented 6 years ago

i have the same problem here. /home/paul/opt/wasm/bin/clang -emit-llvm -O3 --std=c++14 --target=wasm32 -ffreestanding -nostdlib -fno-threadsafe-statics -fno-rtti -fno-exceptions -I /home/paul/blockchain/eos/build/install/include -I . -c huanhuan.cpp -o /tmp/tmp.tv492IsaYQ/built/huanhuan.cpp In file included from huanhuan.cpp:5: In file included from ./huanhuan.hpp:5: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/eosio.hpp:7: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/action.hpp:7: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/datastream.hpp:8: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/vector.hpp:2: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/memory.hpp:8: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/print.hpp:6: /home/paul/blockchain/eos/build/install/include/eosiolib/print.h:74:26: error: unknown type name 'uint128_t' void printi128( const uint128_t value ); ^ In file included from huanhuan.cpp:5: In file included from ./huanhuan.hpp:5: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/eosio.hpp:7: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/action.hpp:7: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/datastream.hpp:8: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/vector.hpp:2: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/memory.hpp:8: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/print.hpp:8: In file included from /home/paul/blockchain/eos/build/install/include/eosiolib/math.hpp:6: /home/paul/blockchain/eos/build/install/include/eosiolib/math.h:32:21: error: unknown type name 'uint128_t' void multeq_i128( uint128_t self, const uint128_t* other );

riotom commented 6 years ago

Hi! Please tell my - you use 32bit Ubuntu? I think you need try it again on 64bit

riotom commented 6 years ago

also - i use branch x2 and on it i dont get any problem with compile.

git clone -b dawn-2.x https://github.com/eosio/eos git submodule update --init --recursive cd /root/eos ./build.sh ubuntu build

huanzhengzbt commented 6 years ago

right, master branch doesn't work, however, dawn branch works.

gleehokie commented 6 years ago

The master branch is now working again. Please follow the new hello world tutorial here https://github.com/EOSIO/eos/wiki/Tutorial-Getting-Started-With-Contracts

jchung00 commented 6 years ago

I'm on dawn-v3.0.0 and the same problem still occurs when following the hello world section of the tutorial. I get the error message below when trying to compile when using the exact same code as given: ~/eos-dawn-v3.0.0/eos/build/tools$ ./eosiocpp -o ../contracts/hello/hello.wast ../contracts/hello/hello.cpp ../contracts/hello/hello.cpp:1:10: fatal error: 'eosiolib/eosio.hpp' file not found

include <eosiolib/eosio.hpp>

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

1 error generated.