betachen / tinychain

A simple and useful blockchain instance for learning blockchain technology.
GNU General Public License v2.0
260 stars 80 forks source link

Compile failed. #7

Closed windstamp closed 6 years ago

windstamp commented 6 years ago

The build can not pass.

First error: c++: error: unrecognized command line option ‘-std=c++14’ Solution: Then I change ‘-std=c++14’ to ‘-std=c++1y’.

Senond error: [root@localhost build]# make /usr/bin/cmake -H/home/smb/renshi/github/blockchain/tinychain -B/home/smb/renshi/github/blockchain/tinychain/build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /home/smb/renshi/github/blockchain/tinychain/build/CMakeFiles /home/smb/renshi/github/blockchain/tinychain/build/CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[1]: Entering directory /home/smb/renshi/github/blockchain/tinychain/build' make -f contrib/mongoose/CMakeFiles/mongoose_static.dir/build.make contrib/mongoose/CMakeFiles/mongoose_static.dir/depend make[2]: Entering directory/home/smb/renshi/github/blockchain/tinychain/build' cd /home/smb/renshi/github/blockchain/tinychain/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/smb/renshi/github/blockchain/tinychain /home/smb/renshi/github/blockchain/tinychain/contrib/mongoose /home/smb/renshi/github/blockchain/tinychain/build /home/smb/renshi/github/blockchain/tinychain/build/contrib/mongoose /home/smb/renshi/github/blockchain/tinychain/build/contrib/mongoose/CMakeFiles/mongoose_static.dir/DependInfo.cmake --color= Scanning dependencies of target mongoose_static make[2]: Leaving directory /home/smb/renshi/github/blockchain/tinychain/build' make -f contrib/mongoose/CMakeFiles/mongoose_static.dir/build.make contrib/mongoose/CMakeFiles/mongoose_static.dir/build make[2]: Entering directory/home/smb/renshi/github/blockchain/tinychain/build' /usr/bin/cmake -E cmake_progress_report /home/smb/renshi/github/blockchain/tinychain/build/CMakeFiles 3 [ 5%] Building C object contrib/mongoose/CMakeFiles/mongoose_static.dir/mongoose.c.o cd /home/smb/renshi/github/blockchain/tinychain/build/contrib/mongoose && /usr/bin/cc -DBOOST_NO_AUTO_PTR=1 -DBOOST_NO_TYPEID=1 -DMG_DISABLE_STDIO -DMVS_DEBUG=1 -std=c11 -fstrict-aliasing -fvisibility=hidden -Wall -Werror -Wstrict-aliasing=2 -Wno-unused-parameter -Wno-unused-variable -Wno-type-limits -Wno-deprecated-register -Wno-deprecated-declarations -pthread -fno-strict-aliasing -g -I/usr/local/include -I/home/smb/renshi/github/blockchain/tinychain/contrib -I/home/smb/renshi/github/blockchain/tinychain/include -o CMakeFiles/mongoose_static.dir/mongoose.c.o -c /home/smb/renshi/github/blockchain/tinychain/contrib/mongoose/mongoose.c Linking C static library ../../lib/libmongoose.a cd /home/smb/renshi/github/blockchain/tinychain/build/contrib/mongoose && /usr/bin/cmake -P CMakeFiles/mongoose_static.dir/cmake_clean_target.cmake cd /home/smb/renshi/github/blockchain/tinychain/build/contrib/mongoose && /usr/bin/cmake -E cmake_link_script CMakeFiles/mongoose_static.dir/link.txt --verbose=1 /usr/bin/ar cr ../../lib/libmongoose.a CMakeFiles/mongoose_static.dir/mongoose.c.o /usr/bin/ranlib ../../lib/libmongoose.a make[2]: Leaving directory /home/smb/renshi/github/blockchain/tinychain/build' /usr/bin/cmake -E cmake_progress_report /home/smb/renshi/github/blockchain/tinychain/build/CMakeFiles 3 [ 5%] Built target mongoose_static make -f contrib/jsoncpp/CMakeFiles/jsoncpp_static.dir/build.make contrib/jsoncpp/CMakeFiles/jsoncpp_static.dir/depend make[2]: Entering directory/home/smb/renshi/github/blockchain/tinychain/build' cd /home/smb/renshi/github/blockchain/tinychain/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/smb/renshi/github/blockchain/tinychain /home/smb/renshi/github/blockchain/tinychain/contrib/jsoncpp /home/smb/renshi/github/blockchain/tinychain/build /home/smb/renshi/github/blockchain/tinychain/build/contrib/jsoncpp /home/smb/renshi/github/blockchain/tinychain/build/contrib/jsoncpp/CMakeFiles/jsoncpp_static.dir/DependInfo.cmake --color= Scanning dependencies of target jsoncpp_static make[2]: Leaving directory /home/smb/renshi/github/blockchain/tinychain/build' make -f contrib/jsoncpp/CMakeFiles/jsoncpp_static.dir/build.make contrib/jsoncpp/CMakeFiles/jsoncpp_static.dir/build make[2]: Entering directory/home/smb/renshi/github/blockchain/tinychain/build' /usr/bin/cmake -E cmake_progress_report /home/smb/renshi/github/blockchain/tinychain/build/CMakeFiles 2 [ 10%] Building CXX object contrib/jsoncpp/CMakeFiles/jsoncpp_static.dir/jsoncpp.cpp.o cd /home/smb/renshi/github/blockchain/tinychain/build/contrib/jsoncpp && /usr/bin/c++ -DBOOST_NO_AUTO_PTR=1 -DBOOST_NO_TYPEID=1 -DMVS_DEBUG=1 -std=c++1y -fstrict-aliasing -fvisibility=hidden -Wall -Werror -Wstrict-aliasing=2 -Wno-unused-parameter -Wno-unused-variable -Wno-type-limits -Wno-deprecated-register -Wno-deprecated-declarations -pthread -fno-enforce-eh-specs -fnothrow-opt -Wno-reorder -Wno-ignored-qualifiers -Wno-unused-function -Wno-deprecated-declarations -g -I/usr/local/include -I/home/smb/renshi/github/blockchain/tinychain/contrib -I/home/smb/renshi/github/blockchain/tinychain/include -o CMakeFiles/jsoncpp_static.dir/jsoncpp.cpp.o -c /home/smb/renshi/github/blockchain/tinychain/contrib/jsoncpp/jsoncpp.cpp Linking CXX static library ../../lib/libjsoncpp.a cd /home/smb/renshi/github/blockchain/tinychain/build/contrib/jsoncpp && /usr/bin/cmake -P CMakeFiles/jsoncpp_static.dir/cmake_clean_target.cmake cd /home/smb/renshi/github/blockchain/tinychain/build/contrib/jsoncpp && /usr/bin/cmake -E cmake_link_script CMakeFiles/jsoncpp_static.dir/link.txt --verbose=1 /usr/bin/ar cr ../../lib/libjsoncpp.a CMakeFiles/jsoncpp_static.dir/jsoncpp.cpp.o /usr/bin/ranlib ../../lib/libjsoncpp.a make[2]: Leaving directory /home/smb/renshi/github/blockchain/tinychain/build' /usr/bin/cmake -E cmake_progress_report /home/smb/renshi/github/blockchain/tinychain/build/CMakeFiles 2 [ 10%] Built target jsoncpp_static make -f src/CMakeFiles/tinychain.dir/build.make src/CMakeFiles/tinychain.dir/depend make[2]: Entering directory/home/smb/renshi/github/blockchain/tinychain/build' cd /home/smb/renshi/github/blockchain/tinychain/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/smb/renshi/github/blockchain/tinychain /home/smb/renshi/github/blockchain/tinychain/src /home/smb/renshi/github/blockchain/tinychain/build /home/smb/renshi/github/blockchain/tinychain/build/src /home/smb/renshi/github/blockchain/tinychain/build/src/CMakeFiles/tinychain.dir/DependInfo.cmake --color= Scanning dependencies of target tinychain make[2]: Leaving directory /home/smb/renshi/github/blockchain/tinychain/build' make -f src/CMakeFiles/tinychain.dir/build.make src/CMakeFiles/tinychain.dir/build make[2]: Entering directory/home/smb/renshi/github/blockchain/tinychain/build' /usr/bin/cmake -E cmake_progress_report /home/smb/renshi/github/blockchain/tinychain/build/CMakeFiles 4 [ 15%] Building CXX object src/CMakeFiles/tinychain.dir/blockchain.cpp.o cd /home/smb/renshi/github/blockchain/tinychain/build/src && /usr/bin/c++ -DBOOST_NO_AUTO_PTR=1 -DBOOST_NO_TYPEID=1 -DMVS_DEBUG=1 -std=c++1y -fstrict-aliasing -fvisibility=hidden -Wall -Werror -Wstrict-aliasing=2 -Wno-unused-parameter -Wno-unused-variable -Wno-type-limits -Wno-deprecated-register -Wno-deprecated-declarations -pthread -fno-enforce-eh-specs -fnothrow-opt -Wno-reorder -Wno-ignored-qualifiers -Wno-unused-function -g -I/usr/local/include -I/home/smb/renshi/github/blockchain/tinychain/contrib -I/home/smb/renshi/github/blockchain/tinychain/include -o CMakeFiles/tinychain.dir/blockchain.cpp.o -c /home/smb/renshi/github/blockchain/tinychain/src/blockchain.cpp In file included from /home/smb/renshi/github/blockchain/tinychain/src/blockchain.cpp:2:0: /home/smb/renshi/github/blockchain/tinychain/include/tinychain/blockchain.hpp:10:7: internal compiler error: in gen_type_die_with_usage, at dwarf2out.c:19525 class blockchain ^ Please submit a full bug report, with preprocessed source if appropriate. See http://bugzilla.redhat.com/bugzilla for instructions. Preprocessed source stored into /tmp/cccl1HPS.out file, please attach this to your bugreport. make[2]: [src/CMakeFiles/tinychain.dir/blockchain.cpp.o] Error 1 make[2]: Leaving directory `/home/smb/renshi/github/blockchain/tinychain/build' make[1]: [src/CMakeFiles/tinychain.dir/all] Error 2 make[1]: Leaving directory `/home/smb/renshi/github/blockchain/tinychain/build' make: *** [all] Error 2 [root@localhost build]#

Solution: I do not know how to solve this problem.

betachen commented 6 years ago

Hi, Can you provide you compiler info here? gcc version or OS version.

It seems complier issue:

internal compiler error: in gen_type_die_with_usage, at dwarf2out.c:19525

Or maybe try to build tinychain on a newer OS platform.

windstamp commented 6 years ago

Thanks.

[root@localhost ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost ~]# g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost ~]# cmake --version
cmake version 2.8.12.2
[root@localhost ~]# more /etc/issue
\S
Kernel \r on an \m

[root@localhost ~]# cat /proc/version
Linux version 3.10.0-693.2.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Sep 12 22:26:13 UTC 2017
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@localhost ~]#
eagle-dai commented 6 years ago

gcc (GCC) 4.8.5 does not support c++14

betachen commented 6 years ago

Yes, That's truth. You can refer to https://github.com/mvs-org/metaverse#compiler-requirements to upgrade your compiler.