nochowderforyou / clams

Clam Project
MIT License
62 stars 58 forks source link

Error building with Boost v1.58 #211

Closed ShapeShifter499 closed 8 years ago

ShapeShifter499 commented 8 years ago

Hi,

I get the following error, it appears to be because of boost but I have no clue why. Any ideas or fixes? I just made the git clone a few moments ago so it should be up to date as can be with your repo. My system currently has boost and boost-libs versions 1.58

libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
libtoolize: copying file 'build-aux/m4/libtool.m4'
libtoolize: copying file 'build-aux/m4/ltoptions.m4'
libtoolize: copying file 'build-aux/m4/ltsugar.m4'
libtoolize: copying file 'build-aux/m4/ltversion.m4'
libtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /usr/bin/automake line 3936.
configure.ac:52: installing 'build-aux/compile'
configure.ac:15: installing 'build-aux/config.guess'
configure.ac:15: installing 'build-aux/config.sub'
configure.ac:25: installing 'build-aux/install-sh'
configure.ac:25: installing 'build-aux/missing'
Makefile.am:5: warning: user variable 'GZIP_ENV' defined here ...
/usr/share/automake-1.15/am/distdir.am: ... overrides Automake variable 'GZIP_ENV' defined here
Makefile.am:46: warning: user target 'distcleancheck' defined here ...
/usr/share/automake-1.15/am/distdir.am: ... overrides Automake target 'distcleancheck' defined here
src/Makefile.am: installing 'build-aux/depcomp'
src/Makefile.am:225: warning: user target '.mm.o' defined here ...
/usr/share/automake-1.15/am/depend2.am: ... overrides Automake target '.mm.o' defined here
parallel-tests: installing 'build-aux/test-driver'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for g++... g++
checking whether we are using the GNU Objective C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... gcc3
checking how to print strings... printf
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for strip... /usr/bin/strip
checking for gcov... /usr/bin/gcov
checking for lcov... no
checking for java... /usr/bin/java
checking for genhtml... no
checking for git... /usr/bin/git
checking for ccache... no
checking for xgettext... /usr/bin/xgettext
checking for hexdump... /usr/bin/hexdump
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether byte ordering is bigendian... no
checking if compiler needs -Werror to reject unknown flags... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking whether the linker accepts -Wl,--large-address-aware... no
checking for __attribute__((visibility))... yes
checking for __attribute__((dllexport))... no
checking for __attribute__((dllimport))... no
checking whether C++ compiler accepts -Wstack-protector... yes
checking whether C++ compiler accepts -fstack-protector-all... yes
checking whether C++ preprocessor accepts -D_FORTIFY_SOURCE=2... yes
checking whether C++ preprocessor accepts -U_FORTIFY_SOURCE... yes
checking whether the linker accepts -Wl,--dynamicbase... no
checking whether the linker accepts -Wl,--nxcompat... no
checking whether the linker accepts -Wl,-z,relro... yes
checking whether the linker accepts -Wl,-z,now... yes
checking whether C++ compiler accepts -fPIE... yes
checking whether the linker accepts -pie... yes
checking endian.h usability... yes
checking endian.h presence... yes
checking for endian.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking for library containing getaddrinfo_a... -lanl
checking for library containing inet_pton... none required
checking whether strnlen is declared... yes
checking whether le32toh is declared... yes
checking whether le64toh is declared... yes
checking whether htole32 is declared... yes
checking whether htole64 is declared... yes
checking whether be32toh is declared... yes
checking whether be64toh is declared... yes
checking whether htobe32 is declared... yes
checking whether htobe64 is declared... yes
checking for MSG_NOSIGNAL... yes
checking for library containing clock_gettime... none required
checking for visibility attribute... yes
checking whether C++ compiler accepts -fvisibility=hidden... yes
checking for Berkeley DB C++ headers... /usr/include/db4.8/
checking for main in -ldb_cxx-4.8... yes
checking miniupnpc/miniwget.h usability... yes
checking miniupnpc/miniwget.h presence... yes
checking for miniupnpc/miniwget.h... yes
checking for main in -lminiupnpc... yes
checking miniupnpc/miniupnpc.h usability... yes
checking miniupnpc/miniupnpc.h presence... yes
checking for miniupnpc/miniupnpc.h... yes
checking for main in -lminiupnpc... (cached) yes
checking miniupnpc/upnpcommands.h usability... yes
checking miniupnpc/upnpcommands.h presence... yes
checking for miniupnpc/upnpcommands.h... yes
checking for main in -lminiupnpc... (cached) yes
checking miniupnpc/upnperrors.h usability... yes
checking miniupnpc/upnperrors.h presence... yes
checking for miniupnpc/upnperrors.h... yes
checking for main in -lminiupnpc... (cached) yes
checking for boostlib >= 1.20.0... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem... yes
checking whether the Boost::Program_Options library is available... yes
checking for exit in -lboost_program_options... yes
checking whether the Boost::Thread library is available... yes
checking for exit in -lboost_thread... yes
checking whether the Boost::Chrono library is available... yes
checking for exit in -lboost_chrono... yes
checking for working boost reduced exports... yes
checking whether the linker accepts -Wl,--exclude-libs,ALL... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
checking for dynamic linked boost test... yes
checking for SSL... yes
checking for CRYPTO... yes
checking for PROTOBUF... yes
checking for QR... yes
checking for protoc... /usr/bin/protoc
checking whether to build clamd... yes
checking for QT... yes
checking for QT_TEST... yes
checking for QT_DBUS... yes
checking for moc-qt4... /usr/bin/moc-qt4
checking for uic-qt4... /usr/bin/uic-qt4
checking for rcc-qt4... /usr/bin/rcc-qt4
checking for lrelease-qt4... /usr/bin/lrelease-qt4
checking for lupdate-qt4... /usr/bin/lupdate-qt4
checking whether to build Bitcoin Core GUI... yes (Qt4)
checking if ccache should be used... no
checking if wallet should be enabled... yes
checking whether to build with support for UPnP... yes
checking whether to build with UPnP enabled by default... no
checking whether to build GUI with support for D-Bus... yes
checking whether to build GUI with support for QR codes... yes
checking whether to build test_bitcoin-qt... yes
checking whether to build test_bitcoin... yes
checking whether to reduce exports... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating share/setup.nsi
config.status: creating share/qt/Info.plist
config.status: creating src/config/bitcoin-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Fixing libtool for -rpath problems.
Making all in src
make[1]: Entering directory '/home/lance/AUR-packages/clam-git/src/clams/src'
  CXX      libbitcoin_util_a-clientversion.o
  CXX      libbitcoin_util_a-clamspeech.o
  CXX      libbitcoin_util_a-random.o
  CXX      libbitcoin_util_a-rpcprotocol.o
  CXX      support/libbitcoin_util_a-cleanse.o
  CXX      libbitcoin_util_a-sync.o
  CXX      libbitcoin_util_a-version.o
  CXX      libbitcoin_util_a-util.o
  AR       libbitcoin_util.a
  CXX      libbitcoin_common_a-chainparams.o
  CXX      libbitcoin_common_a-hash.o
  CXX      libbitcoin_common_a-key.o
  CXX      libbitcoin_common_a-keystore.o
  CXX      libbitcoin_common_a-netbase.o
  CXX      libbitcoin_common_a-protocol.o
  AR       libbitcoin_common.a
  CXX      libbitcoin_server_a-addrman.o
  CXX      libbitcoin_server_a-alert.o
  CXX      libbitcoin_server_a-checkpoints.o
  CXX      libbitcoin_server_a-init.o
  CXX      libbitcoin_server_a-kernel.o
  CXX      libbitcoin_server_a-main.o
  CXX      libbitcoin_server_a-miner.o
  CXX      libbitcoin_server_a-net.o
  CXX      libbitcoin_server_a-noui.o
  CXX      libbitcoin_server_a-rpcblockchain.o
  CXX      libbitcoin_server_a-rpcclient.o
  CXX      libbitcoin_server_a-rpcmining.o
  CXX      libbitcoin_server_a-rpcmisc.o
  CXX      libbitcoin_server_a-rpcnet.o
  CXX      libbitcoin_server_a-rpcrawtransaction.o
In file included from /usr/include/boost/iterator/iterator_categories.hpp:22:0,
                 from /usr/include/boost/iterator/iterator_facade.hpp:14,
                 from /usr/include/boost/range/iterator_range_core.hpp:27,
                 from /usr/include/boost/range/iterator_range.hpp:13,
                 from /usr/include/boost/assign/list_of.hpp:20,
                 from rpcrawtransaction.cpp:6:
/usr/include/boost/variant/get.hpp: In instantiation of ‘typename boost::add_reference<T>::type boost::strict_get(boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>&) [with U = const CScriptID&; T0 = CNoDestination; T1 = CKeyID; T2 = CScriptID; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_; typename boost::add_reference<T>::type = const CScriptID&]’:
/usr/include/boost/variant/get.hpp:284:25:   required from ‘typename boost::add_reference<T>::type boost::get(boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>&) [with U = const CScriptID&; T0 = CNoDestination; T1 = CKeyID; T2 = CScriptID; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_; typename boost::add_reference<T>::type = const CScriptID&]’
rpcrawtransaction.cpp:225:77:   required from here
/usr/include/boost/variant/get.hpp:178:5: error: invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE<false>’
     BOOST_STATIC_ASSERT_MSG(
     ^
Makefile:2383: recipe for target 'libbitcoin_server_a-rpcrawtransaction.o' failed
make[1]: *** [libbitcoin_server_a-rpcrawtransaction.o] Error 1
make[1]: Leaving directory '/home/lance/AUR-packages/clam-git/src/clams/src'
Makefile:557: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
dooglus commented 8 years ago

I don't know what to tell you. I guess it's a problem with the version of Boost you're using, but I'm not sure.

I'm using 1.54 and it builds for me. Do you have a way of trying to build with that version?

dooglus commented 8 years ago

I just tried building against Boost 1.58 and got a very similar error:

$ make libbitcoin_server_a-rpcrawtransaction.o
  CXX      libbitcoin_server_a-rpcrawtransaction.o
In file included from /usr/include/boost/iterator/iterator_categories.hpp:22:0,
                 from /usr/include/boost/iterator/iterator_facade.hpp:14,
                 from /usr/include/boost/range/iterator_range_core.hpp:27,
                 from /usr/include/boost/range/iterator_range.hpp:13,
                 from /usr/include/boost/assign/list_of.hpp:20,
                 from rpcrawtransaction.cpp:6:
/usr/include/boost/variant/get.hpp: In instantiation of ‘typename boost::add_reference<T>::type boost::strict_get(boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>&) [with U = const CScriptID&; T0 = CNoDestination; T1 = CKeyID; T2 = CScriptID; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_; typename boost::add_reference<T>::type = const CScriptID&]’:
/usr/include/boost/variant/get.hpp:284:33:   required from ‘typename boost::add_reference<T>::type boost::get(boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>&) [with U = const CScriptID&; T0 = CNoDestination; T1 = CKeyID; T2 = CScriptID; T3 = boost::detail::variant::void_; T4 = boost::detail::variant::void_; T5 = boost::detail::variant::void_; T6 = boost::detail::variant::void_; T7 = boost::detail::variant::void_; T8 = boost::detail::variant::void_; T9 = boost::detail::variant::void_; T10 = boost::detail::variant::void_; T11 = boost::detail::variant::void_; T12 = boost::detail::variant::void_; T13 = boost::detail::variant::void_; T14 = boost::detail::variant::void_; T15 = boost::detail::variant::void_; T16 = boost::detail::variant::void_; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_; typename boost::add_reference<T>::type = const CScriptID&]’
rpcrawtransaction.cpp:225:77:   required from here
/usr/include/boost/variant/get.hpp:178:5: error: invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE<false>’
     BOOST_STATIC_ASSERT_MSG(
     ^
make: *** [libbitcoin_server_a-rpcrawtransaction.o] Error 1
dooglus commented 8 years ago

I get the same error from compiling this minimal source:

#include <boost/assign/list_of.hpp>
#include "wallet.h"

void foo(void)
{
    CTxDestination address;
    boost::get<const CScriptID&>(address);
}
dooglus commented 8 years ago

Does this fix the problem?

diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp
index 0ec00cc..3963a36 100644
--- a/src/rpcrawtransaction.cpp
+++ b/src/rpcrawtransaction.cpp
@@ -222,7 +222,7 @@ Value listunspent(const Array& params, bool fHelp)
             CTxDestination address;
             if (ExtractDestination(pk, address))
             {
-                const CScriptID& hash = boost::get<const CScriptID&>(address);
+                const CScriptID& hash = boost::get<const CScriptID>(address);
                 CScript redeemScript;
                 if (pwalletMain->GetCScript(hash, redeemScript))
                     entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));
dooglus commented 8 years ago

That seems to do it.

Here's the same fix in bitcoin: https://github.com/bitcoin/bitcoin/commit/8b08d95

dooglus commented 8 years ago

Fixed in c7b62b5712.

ShapeShifter499 commented 8 years ago

Wow that was fast! I just tested it on my end, thank you for the update.

9cat commented 7 years ago

Thanks, it solved my problem.