I am trying to compile the latest bitcoin source from GitHub on the latest SmartOS and do not know how to solve the following compile error…
0/opt/local/src/bitcoin]# uname -a
1SunOS a36dbe40-5628-e6ea-f7b8-8d89982fe9bf 5.11 joyent_20180525T172343Z i86pc i386 i86pc Solaris
2
3/opt/local/src/bitcoin]# gcc -v
4Using built-in specs.
5COLLECT_GCC=/opt/local/gcc49/bin/gcc
6COLLECT_LTO_WRAPPER=/opt/local/gcc49/libexec/gcc/x86_64-sun-solaris2.11/4.9.3/lto-wrapper
7Target: x86_64-sun-solaris2.11
8Configured with: ../gcc-4.9.3/configure --enable-languages='c obj-c++ objc go fortran c++' --enable-shared --enable-long-long --with-local-prefix=/opt/local --enable-libssp --enable-threads=posix --with-boot-ldflags='-static-libstdc++ -static-libgcc -Wl,-R/opt/local/lib ' --disable-nls --with-gxx-include-dir=/opt/local/gcc49/include/c++/ --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/opt/local/bin/gas --prefix=/opt/local/gcc49 --build=x86_64-sun-solaris2.11 --host=x86_64-sun-solaris2.11 --infodir=/opt/local/gcc49/info --mandir=/opt/local/gcc49/man
9Thread model: posix
10gcc version 4.9.3 (GCC)
11
12/opt/local/src/bitcoin]# ./configure --with-gui=no --disable-tests --enable-cxx --disable-shared --with-pic --prefix=/usr/local --with-incompatible-bdb --target=x86_64-sun-solaris2.11
13...
14Options used to compile and link:
15 with wallet = yes
16 with gui / qt = no
17 with zmq = no
18 with test = no
19 with bench = yes
20 with upnp = auto
21 use asm = yes
22 sanitizers =
23 debug enabled = no
24 gprof enabled = no
25 werror = no
26
27 target os =
28 build os =
29
30 CC = gcc
31 CFLAGS = -g -O2
32 CPPFLAGS = -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS
33 CXX = g++ -std=c++11
34 CXXFLAGS = -Wstack-protector -fstack-protector-all -Wall -Wextra -Wformat -Wvla -Wno-unused-parameter -g -O2
35 LDFLAGS = -D_POSIX_PTHREAD_SEMANTICS -pthread -Wl,-z,now -pie
36 ARFLAGS = cr
37
38
39/opt/local/src/bitcoin]# make
40Making all in src
41make[1]: Entering directory '/opt/local/src/bitcoin/src'
42make[2]: Entering directory '/opt/local/src/bitcoin/src'
43make[3]: Entering directory '/opt/local/src/bitcoin'
44make[3]: Leaving directory '/opt/local/src/bitcoin'
45 CXX crypto/libbitcoinconsensus_la-aes.lo
46 CXX crypto/libbitcoinconsensus_la-chacha20.lo
47 CXX crypto/libbitcoinconsensus_la-hmac_sha256.lo
48 CXX crypto/libbitcoinconsensus_la-hmac_sha512.lo
49 CXX crypto/libbitcoinconsensus_la-ripemd160.lo
50 CXX crypto/libbitcoinconsensus_la-sha1.lo
51 CXX crypto/libbitcoinconsensus_la-sha256.lo
52 CXX crypto/libbitcoinconsensus_la-sha512.lo
53 CXX crypto/libbitcoinconsensus_la-sha256_sse4.lo
54 CXX libbitcoinconsensus_la-arith_uint256.lo
55 CXX consensus/libbitcoinconsensus_la-merkle.lo
56In file included from ./script/script.h:11:0,
57 from ./primitives/transaction.h:11,
58 from ./consensus/merkle.h:11,
59 from consensus/merkle.cpp:5:
60./serialize.h:193:39: error: redefinition of 'template<class Stream> void Serialize(Stream&, int8_t)'
61 template<typename Stream> inline void Serialize(Stream& s, int8_t a ) { ser_wr
62 ^
63./serialize.h:192:39: note: 'template<class Stream> void Serialize(Stream&, char)' previously declared here
64 template<typename Stream> inline void Serialize(Stream& s, char a ) { ser_wr
65 ^
66In file included from ./script/script.h:11:0,
67 from ./primitives/transaction.h:11,
68 from ./consensus/merkle.h:11,
69 from consensus/merkle.cpp:5:
70./serialize.h:209:39: error: redefinition of 'template<class Stream> void Unserialize(Stream&, int8_t&)'
71 template<typename Stream> inline void Unserialize(Stream& s, int8_t& a ) { a =
72 ^
73./serialize.h:208:39: note: 'template<class Stream> void Unserialize(Stream&, char&)' previously declared here
74 template<typename Stream> inline void Unserialize(Stream& s, char& a ) { a =
75 ^
76Makefile:8138: recipe for target 'consensus/libbitcoinconsensus_la-merkle.lo' failed
77make[2]: *** [consensus/libbitcoinconsensus_la-merkle.lo] Error 1
78make[2]: Leaving directory '/opt/local/src/bitcoin/src'
79Makefile:9824: recipe for target 'all-recursive' failed
80make[1]: *** [all-recursive] Error 1
81make[1]: Leaving directory '/opt/local/src/bitcoin/src'
82Makefile:756: recipe for target 'all-recursive' failed
83make: *** [all-recursive] Error 1