eos icon indicating copy to clipboard operation
eos copied to clipboard

/usr/local/include/eosiolib/types.h:7:10: fatal error: 'stdint.h' file not found on mac

Open itsmeprasanjit opened this issue 8 years ago • 11 comments

`#include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio;

class hello : public eosio::contract { public: using contract::contract;

  /// @abi action 
  void hi( account_name user ) {
     print( "Hello, ", name{user} );
  }

};

EOSIO_ABI( hello, (hi) )`

I have already run sudo make install in build eosiocpp -o hello.wast hello.cpp this gives me error of : /usr/local/include/eosiolib/types.h:7:10: fatal error: 'stdint.h' file not found

itsmeprasanjit avatar May 06 '18 11:05 itsmeprasanjit

@itsmeprasanjit find /usr -name stdint.h -print 2>/dev/null

pacificcode avatar May 08 '18 15:05 pacificcode

do you solve this problem?

mylesshie avatar May 10 '18 07:05 mylesshie

I got the same problem when I use './eosiocpp -o hello.wast hello.cpp', then I change the command to 'eosiocpp -o hello.wast hello.cpp', success.

Duffyxx avatar May 15 '18 08:05 Duffyxx

+1 same problem

qs-lll avatar May 17 '18 09:05 qs-lll

+1 same problem

navcsdev avatar May 23 '18 10:05 navcsdev

+1 same problem

sikeeoh avatar May 26 '18 15:05 sikeeoh

I solved it. In bulid/tools/eosiocpp file, the EOSIO_INSTALL_DIR path is initialized as ~/eos/build. And the compiler's include path argument is ...

 ($PRINT_CMDS; /usr/local/wasm/bin/clang -emit-llvm -O3 --std=c++14 --target=wasm32 -nostdinc \
                                   -nostdlib -nostdlibinc -ffreestanding -nostdlib -fno-threadsafe-statics -fno-rtti \
                                   -fno-exceptions -I ${EOSIO_INSTALL_DIR}/include \
                                   -I${EOSIO_INSTALL_DIR}/include/libc++/upstream/include \    // <<----------
                                   -I${EOSIO_INSTALL_DIR}/include/musl/upstream/include \       // <<----------
                                   -I${BOOST_INCLUDE_DIR} \
                                   -I $filePath \
                                   -c $file -o $workdir/built/$name
        )

So the actual include path is ~/eos/build/include/libc++/upstream/include, therefore can't find a stdint.h.

I modifed the $EOSIO_INSTALL_DIR as /usr/local in ~/eos/tools/eosiocpp.in, and re-make install my ~/eos/build/tools, then i succeed to compile.

CityOfStars avatar Jul 08 '18 04:07 CityOfStars

This worked for me. Just remember to change to backticks to quotes in the $EOSIO_INSTALL_DIR value.

timwbodine avatar Jul 17 '18 16:07 timwbodine

@itsmeprasanjit do you still have this issue on latest version of eos? v1.1.0

andriantolie avatar Jul 19 '18 08:07 andriantolie

This worked for me:

cd ~/eos/build
make install

and after that try to build smart contact.

Di0niz avatar Aug 09 '18 09:08 Di0niz

Please try using the eosio.cdt 1.3.2

If you still have the problem and wish to discuss further, please post it in https://eosio.stackexchange.com. To keep things organized, Github issues are intended for bugs reporting and features tracking, and Stack Exchange is the right place for any technical support discussions. Thanks!

halsaphi avatar Oct 30 '18 06:10 halsaphi