eos icon indicating copy to clipboard operation
eos copied to clipboard

error: 'operator new' takes type size_t ('unsigned long') as first parameter

Open 2liang opened this issue 8 years ago • 3 comments

ubuntu 16.04 use eosio_build.sh install eos error:

/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:179:36: error: 'operator new' takes type size_t ('unsigned long') as first parameter
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                   ^
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:180:36: error: 'operator new' takes type size_t ('unsigned long') as first parameter
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
                                   ^
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:187:36: error: 'operator new[]' takes type size_t ('unsigned long') as first parameter
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
                                   ^
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:188:36: error: 'operator new[]' takes type size_t ('unsigned long') as first parameter
_LIBCPP_OVERRI

2liang avatar Apr 05 '18 17:04 2liang

Well need a little information on your system and build tools to help out. run the script ./eosio_build.sh Paste all the install information when the script begins down to:

ALL dependencies sucessfully found or installed . Installing EOS.IO

pacificcode avatar Apr 05 '18 17:04 pacificcode

@pacificcode thx, install information:

liang@block:~/liangwl/eos$ ./eosio_build.sh

	Beginning build version: 1.2
	2018年 04月 09日 星期一 05:21:33 UTC
	git head id: c721c31d6fb0da210dccf03e2d7edfa0910c5144
	Current branch: * master

	ARCHITECTURE: Linux

	OS name: Ubuntu
	OS Version: 16.04
	CPU speed: 4294Mhz
	CPU cores: 1
	Physical Memory: 4449 Mgb
	Disk install: /dev/sda1
	Disk space total: 44G
	Disk space available: 29G

	Checking for installed dependencies.

	Package clang-4.0 found.
	Package lldb-4.0 found.
	Package libclang-4.0-dev found.
	Package cmake found.
	Package make found.
	Package libbz2-dev found.
	Package libssl-dev found.
	Package libgmp3-dev found.
	Package autotools-dev found.
	Package build-essential found.
	Package libbz2-dev found.
	Package libicu-dev found.
	Package python3-dev found.
	Package autoconf found.
	Package libtool found.
	Package curl found.

	No required dpkg dependencies to install.

	Checking boost library installation.
	Boost 1.66 found at /home/liang/opt/boost_1_66_0

	Checking MongoDB installation.
	MongoDB configuration found at /home/liang/opt/mongodb/mongod.conf.

	Checking MongoDB C++ driver installation.
	Mongo C++ driver found at /usr/local/lib/libmongocxx-static.a.

	Checking for secp256k1-zkp
	secp256k1 found

	Checking for LLVM with WASM support.
	WASM found at /home/liang/opt/wasm/bin


>>>>>>>> ALL dependencies sucessfully found or installed . Installing EOS.IO

-- Using custom FindBoost.cmake
-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   filesystem
--   system
--   program_options
--   signals
--   serialization
--   chrono
--   unit_test_framework
--   context
--   locale
--   iostreams
-- Configuring Eos on Linux
-- binaryen building with -std=c++11
-- binaryen building for platform x86-64
-- binaryen building with -Wall
-- binaryen building with -Werror
-- binaryen building with -Wextra
-- binaryen building with -Wno-unused-parameter
-- binaryen building with -fno-omit-frame-pointer
-- binaryen building with -fPIC
-- binaryen building with -O2
-- binaryen building with -UNDEBUG
-- Using WASM clang => /home/liang/opt/wasm/bin/clang
-- Using WASM llc => /home/liang/opt/wasm/bin/llc
-- Using WASM llvm-link => /home/liang/opt/wasm/bin/llvm-link
-- Found Secp256k1: /usr/local/lib/libsecp256k1.a
-- Configuring fc to build on Unix/Apple
-- Setting up OpenSSL root and include vars to /usr/include/openssl, /usr/include/openssl/include
-- zlib found
-- bzip2 found
-- Configuring SoftFloat
-- Using custom FindBoost.cmake
-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   filesystem
--   system
--   chrono
--   unit_test_framework
--   locale
-- Configuring ChainBase on Linux
-- Using custom FindBoost.cmake
-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   filesystem
--   system
--   chrono
--   program_options
--   unit_test_framework
--   locale
-- Configuring AppBase on Linux
-- Found bsoncxx headers: /usr/local/include/bsoncxx/v_noabi
-- Found bsoncxx library: /usr/local/lib/libbsoncxx-static.a;/usr/local/lib/libbson-static-1.0.a;-lm;-pthread
-- Found mongocxx headers: /usr/local/include/mongocxx/v_noabi;/usr/local/include/bsoncxx/v_noabi
-- Found mongocxx library: /usr/local/lib/libmongocxx-static.a;/usr/local/lib/libbsoncxx-static.a;/usr/local/lib/libbson-static-1.0.a;-lm;-pthread;/usr/local/lib/libmongoc-static-1.0.a;/usr/local/lib/libbson-static-1.0.a;-lm;-pthread;-lsasl2;-lssl;-lcrypto;-lrt;-lz;-lresolv
-- Git commit revision: c721c31d
-- Git commit revision: c721c31d
-- Git commit revision: c721c31d
-- Configuring done
WARNING: Target "chainbase_test" requests linking to directory "/usr/include/openssl".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/liang/liangwl/eos/build
[  0%] Built target binaryen
[  0%] Built target wasm
[  1%] Built target ast
[  1%] Built target asmjs
[  1%] Built target cfg
[  4%] Built target passes
[  5%] Built target support
[  5%] Built target eosio-s2wasm
[  5%] Built target emscripten-optimizer
[ 10%] Built target fc
[ 10%] Built target test_cypher_suites
[ 34%] Built target softfloat
[ 34%] Built target chainbase
[ 34%] Built target chainbase_test
[ 34%] Built target Platform
[ 35%] Built target Logging
[ 35%] Built target IR
[ 36%] Built target Runtime
[ 36%] Built target Emscripten
[ 36%] Built target WASM
[ 37%] Built target WAST
[ 38%] Built target wavm
[ 38%] Built target Test
[ 38%] Built target Disassemble
[ 38%] Built target Assemble
[ 39%] Built target eos_utilities
[ 39%] Built target appbase
[ 40%] Built target appbase_example
[ 42%] Built target eosio_chain
[ 42%] Built target chain_plugin
[ 42%] Building LLVM bitcode vector.cpp.bc
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/src/vector.cpp:10:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/vector:265:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/iosfwd:90:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/wchar.h:119:
In file included from /home/liang/liangwl/eos/contracts/musl/upstream/include/wchar.h:27:
/home/liang/liangwl/eos/contracts/musl/upstream/include/bits/alltypes.h:36:23: error: expected ';' after top level declarator
typedef unsigned _Addr size_t;
                      ^
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/src/vector.cpp:10:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/vector:266:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/__bit_reference:15:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/algorithm:643:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/memory:647:
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:179:36: error: 'operator new' takes type size_t
      ('unsigned long') as first parameter
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                   ^
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:180:36: error: 'operator new' takes type size_t
      ('unsigned long') as first parameter
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
                                   ^
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:187:36: error: 'operator new[]' takes type size_t
      ('unsigned long') as first parameter
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
                                   ^
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:188:36: error: 'operator new[]' takes type size_t
      ('unsigned long') as first parameter
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
                                   ^
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:213:40: error: 'operator new' takes type size_t
      ('unsigned long') as first parameter
inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
                                       ^
/home/liang/liangwl/eos/contracts/libc++/upstream/include/new:214:40: error: 'operator new[]' takes type size_t
      ('unsigned long') as first parameter
inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
                                       ^
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/src/vector.cpp:10:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/vector:266:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/__bit_reference:15:
In file included from /home/liang/liangwl/eos/contracts/libc++/upstream/include/algorithm:643:
/home/liang/liangwl/eos/contracts/libc++/upstream/include/memory:1960:73: error: too many arguments to function call,
      expected 1, have 2
        __r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), nothrow));
                                      ~~~~~~~~~~~~~~                    ^~~~~~~
note: 'operator new' declared here
8 errors generated.
contracts/libc++/CMakeFiles/libc++.dir/build.make:215: recipe for target 'contracts/libc++/vector.cpp.bc' failed
make[2]: *** [contracts/libc++/vector.cpp.bc] Error 1
CMakeFiles/Makefile2:2245: recipe for target 'contracts/libc++/CMakeFiles/libc++.dir/all' failed
make[1]: *** [contracts/libc++/CMakeFiles/libc++.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

	>>>>>>>>>>>>>>>>>>>> MAKE building EOSIO has exited with the above error.

2liang avatar Apr 09 '18 05:04 2liang

@2liang I would run the following commands and you should be good.

rm -rf /path/to/eos/build cd /path/to/eos git pull git submodule update --init --recursive ./eosio_build.sh

Please open a new issue if you run into any problems, closing this issue now.

pacificcode avatar Apr 16 '18 20:04 pacificcode