livenet123 / Newton

Newton Coin Project
GNU Lesser General Public License v3.0
10 stars 11 forks source link

problem with compilation #1

Open cryptomaxsun opened 6 years ago

cryptomaxsun commented 6 years ago

Hello! I'm doing a daemon compilation for the pool, an error, how do I fix it?

[ 43%] Building CXX object src/CMakeFiles/P2P.dir/P2p/P2pContextOwner.cpp.o
Linking CXX static library libP2P.a
make[3]: Leaving directory `/home/max/Newton/build/release'
[ 43%] Built target P2P
make[3]: Entering directory `/home/max/Newton/build/release'
Scanning dependencies of target Rpc
make[3]: Leaving directory `/home/max/Newton/build/release'
make[3]: Entering directory `/home/max/Newton/build/release'
[ 43%] Building CXX object src/CMakeFiles/Rpc.dir/Rpc/RpcServer.cpp.o
In file included from /home/max/Newton/src/Rpc/RpcServer.cpp:18:0:
/home/max/Newton/src/Rpc/RpcServer.h:41:15: error: ‘__cxx11’ is not a member of ‘std’
   std::vector<std::__cxx11::string> getCorsDomains();
               ^
/home/max/Newton/src/Rpc/RpcServer.h:41:15: error: ‘__cxx11’ is not a member of ‘std’
/home/max/Newton/src/Rpc/RpcServer.h:41:35: error: template argument 1 is invalid
   std::vector<std::__cxx11::string> getCorsDomains();
                                   ^
/home/max/Newton/src/Rpc/RpcServer.h:41:35: error: template argument 2 is invalid
/home/max/Newton/src/Rpc/RpcServer.cpp: In lambda function:
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53: error: no matching function for call to ‘begin(int&)’
  for (const auto& cors_domain : obj->getCorsDomains()) {
                 from /home/max/Newton/src/Rpc/RpcServer.h:18,
                 from /home/max/Newton/src/Rpc/RpcServer.cpp:18:
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^
/usr/include/c++/4.8/bits/range_access.h:58:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = int]’:/home/max/Newton/src/Rpc/RpcServer.cpp:100:53:   required from here
/usr/include/c++/4.8/bits/range_access.h:58:5: error: request for member ‘begin’ in ‘__cont’, which is of non-class type ‘const int’
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())     ^
/usr/include/c++/4.8/bits/range_access.h:48:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = int]’: 
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53:   required from here
/usr/include/c++/4.8/bits/range_access.h:48:5: error: request for member ‘begin’ in ‘__cont’, which is of non-class type ‘int’
In file included from /usr/include/c++/4.8/utility:74:0,
                 from /usr/include/c++/4.8/unordered_set:38,
                 from /home/max/Newton/src/Rpc/HttpServer.h:20,
                 from /home/max/Newton/src/Rpc/RpcServer.h:18,
                 from /home/max/Newton/src/Rpc/RpcServer.cpp:18:
/usr/include/c++/4.8/initializer_list:89:5: note: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
     begin(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.8/initializer_list:89:5: note:   template argument deduction/substitution failed:
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
  for (const auto& cors_domain : obj->getCorsDomains()) {
                                                     ^
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53: error: no matching function for call to ‘end(int&)’
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53: note: candidates are:
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/stdexcept:39,
                 from /usr/include/c++/4.8/array:38,
                 from /usr/include/c++/4.8/tuple:39,
                 from /usr/include/c++/4.8/unordered_set:41,
                 from /home/max/Newton/src/Rpc/HttpServer.h:20,
                 from /home/max/Newton/src/Rpc/RpcServer.h:18,
                 from /home/max/Newton/src/Rpc/RpcServer.cpp:18:
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
     end(_Tp (&__arr)[_Nm])
     ^
/usr/include/c++/4.8/bits/range_access.h:97:5: note:   template argument deduction/substitution failed:
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53: note:   mismatched types ‘_Tp [_Nm]’ and ‘int’
  for (const auto& cors_domain : obj->getCorsDomains()) {
                                                     ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/stdexcept:39,
                 from /usr/include/c++/4.8/array:38,
                 from /usr/include/c++/4.8/tuple:39,
                 from /usr/include/c++/4.8/unordered_set:41,
                 from /home/max/Newton/src/Rpc/HttpServer.h:20,
                 from /home/max/Newton/src/Rpc/RpcServer.h:18,
                 from /home/max/Newton/src/Rpc/RpcServer.cpp:18:
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
     end(const _Container& __cont) -> decltype(__cont.end())
     ^
/usr/include/c++/4.8/bits/range_access.h:78:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = int]’:
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53:   required from here
/usr/include/c++/4.8/bits/range_access.h:78:5: error: request for member ‘end’ in ‘__cont’, which is of non-class type ‘const int’
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
     end(_Container& __cont) -> decltype(__cont.end())
     ^
/usr/include/c++/4.8/bits/range_access.h:68:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = int]’:
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53:   required from here
/usr/include/c++/4.8/bits/range_access.h:68:5: error: request for member ‘end’ in ‘__cont’, which is of non-class type ‘int’
In file included from /usr/include/c++/4.8/utility:74:0,
                 from /usr/include/c++/4.8/unordered_set:38,
                 from /home/max/Newton/src/Rpc/HttpServer.h:20,
                 from /home/max/Newton/src/Rpc/RpcServer.h:18,
                 from /home/max/Newton/src/Rpc/RpcServer.cpp:18:
/usr/include/c++/4.8/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
     end(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.8/initializer_list:99:5: note:   template argument deduction/s/home/max/Newton/src/Rpc/RpcServer.cpp:100:53: note:   mismatched types ‘_Tp [_Nm]’ and ‘int’
  for (const auto& cors_domain : obj->getCorsDomains()) {                                                     ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/stdexcept:39,
                 from /usr/include/c++/4.8/array:38,
                 from /usr/include/c++/4.8/tuple:39,                 from /usr/include/c++/4.8/unordered_set:41,                 from /home/max/Newton/src/Rpc/HttpServer.h:20,
                 from /home/max/Newton/src/Rpc/RpcServer.h:18,
                 from /home/max/Newton/src/Rpc/RpcServer.cpp:18:
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
     end(const _Container& __cont) -> decltype(__cont.end())     ^
/usr/include/c++/4.8/bits/range_access.h:78:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = int]’:
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53:   required from here
/usr/include/c++/4.8/bits/range_access.h:78:5: error: request for member ‘end’ in ‘__cont’, which is of non-class type ‘const int’
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
     end(_Container& __cont) -> decltype(__cont.end())
     ^
/usr/include/c++/4.8/bits/range_access.h:68:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = int]’:
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53:   required from here/usr/include/c++/4.8/bits/range_access.h:68:5: error: request for member ‘end’ in ‘__cont’, which is of non-class type ‘int’
In file included from /usr/include/c++/4.8/utility:74:0,
                 from /usr/include/c++/4.8/unordered_set:38,
                 from /home/max/Newton/src/Rpc/HttpServer.h:20,
                 from /home/max/Newton/src/Rpc/RpcServer.h:18,
                 from /home/max/Newton/src/Rpc/RpcServer.cpp:18:
/usr/include/c++/4.8/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
     end(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.8/initializer_list:99:5: note:   template argument deduction/substitution failed:
/home/max/Newton/src/Rpc/RpcServer.cpp:100:53: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
  for (const auto& cors_domain : obj->getCorsDomains()) {
                                                     ^
/home/max/Newton/src/Rpc/RpcServer.cpp: At global scope:
/home/max/Newton/src/Rpc/RpcServer.cpp:227:26: error: prototype for ‘std::vector<std::basic_string<char> > CryptoNote::RpcServer::getCorsDomains()’ does not match any in class ‘CryptoNote::RpcServer’
 std::vector<std::string> RpcServer::getCorsDomains() {
                          ^
In file included from /home/max/Newton/src/Rpc/RpcServer.cpp:18:0:
/home/max/Newton/src/Rpc/RpcServer.h:41:37: error: candidate is: int CryptoNote::RpcServer::getCorsDomains()
   std::vector<std::__cxx11::string> getCorsDomains();
                                     ^
make[3]: *** [src/CMakeFiles/Rpc.dir/Rpc/RpcServer.cpp.o] Error 1
make[3]: Leaving directory `/home/max/Newton/build/release'
make[2]: *** [src/CMakeFiles/Rpc.dir/all] Error 2
make[2]: Leaving directory `/home/max/Newton/build/release'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/max/Newton/build/release'
make: *** [build-release] Error 2
livenet123 commented 6 years ago

fixed now

cryptomaxsun commented 6 years ago

anyway an error

er options.
 #error This file requires compiler and library support for the \
  ^
In file included from /usr/include/c++/4.8/unordered_map:35:0,
                 from ./include/rocksdb/options.h:18,
ntly experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^In file included from /usr/include/c++/4.8/unordered_map:35:0,                 from ./db/filename.h:14,                 from ./db/auto_roll_logger.h:13,
                 from db/auto_roll_logger.cc:6:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^make[4]: *** No rule to make target `make_config.mk'.  Stop.make[4]: Leaving directory `/home/max/Newton/external/rocksdb'make[3]: *** [external/CMakeFiles/rocksdb] Error 2
make[3]: Leaving directory `/home/max/Newton/build/release'
make[2]: *** [external/CMakeFiles/rocksdb.dir/all] Error 2
livenet123 commented 6 years ago

type this before make export CXXFLAGS="-std=gnu++11"

cryptomaxsun commented 6 years ago

did. still an error.

Scanning dependencies of target ConnectivityTool
make[3]: Leaving directory `/home/max/Newton/build/release'
make[3]: Entering directory `/home/max/Newton/build/release'
[ 45%] Building CXX object src/CMakeFiles/ConnectivityTool.dir/ConnectivityTool/ConnectivityTool.cpp.oLinking CXX executable connectivity_tool
make[3]: Leaving directory `/home/max/Newton/build/release'
[ 45%] Built target ConnectivityTool
make[3]: Entering directory `/home/max/Newton/build/release'
Scanning dependencies of target rocksdb
make[3]: Leaving directory `/home/max/Newton/build/release'
make[3]: Entering directory `/home/max/Newton/build/release'
/bin/sh: 1: /home/max/Newton/external/rocksdb/build_tools/build_detect_platform: Permission denied
make[4]: Entering directory `/home/max/Newton/external/rocksdb'
Makefile:142: make_config.mk: No such file or directory
grep: /home/max/Newton/external/rocksdb/make_config.mk: No such file or directory
  GEN      util/build_version.cc
make[4]: *** No rule to make target `make_config.mk'.  Stop.
make[4]: Leaving directory `/home/max/Newton/external/rocksdb'
make[3]: *** [external/CMakeFiles/rocksdb] Error 2
make[3]: Leaving directory `/home/max/Newton/build/release'
make[2]: *** [external/CMakeFiles/rocksdb.dir/all] Error 2
make[2]: Leaving directory `/home/max/Newton/build/release'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/max/Newton/build/release'
make: *** [build-release] Error 2
livenet123 commented 6 years ago

try this

export CXXFLAGS="-std=gnu++11"
cd Newton
chmod +x external/rocksdb/build_tools/build_detect_platform
chmod +x external/rocksdb/build_tools/version.sh
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DSTATIC=true .. && make
cryptomaxsun commented 6 years ago

Thank you! Compilation is successful.

cryptomaxsun commented 5 years ago
[ 78%] Building CXX object tests/CMakeFiles/CoreTests.dir/CoreTests/ChaingenMain.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
tests/CMakeFiles/CoreTests.dir/build.make:254: recipe for target 'tests/CMakeFiles/CoreTests.dir/CoreTests/ChaingenMain.cpp.o' failed
make[2]: *** [tests/CMakeFiles/CoreTests.dir/CoreTests/ChaingenMain.cpp.o] Error 4
CMakeFiles/Makefile2:1401: recipe for target 'tests/CMakeFiles/CoreTests.dir/all' failed
make[1]: *** [tests/CMakeFiles/CoreTests.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Binary daemon no start: illegal instruction

livenet123 commented 5 years ago

it seems you are out of memory while building you need to increase the vps ram. the source built successfully on gcc 5. the binary show illegal instruction because the vps cpu is old you can use the binary available here http://newtoncoin.cf

cryptomaxsun commented 5 years ago

Thanks, the daemon started.