Closed ShapeShifter499 closed 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?
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
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);
}
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())));
That seems to do it.
Here's the same fix in bitcoin: https://github.com/bitcoin/bitcoin/commit/8b08d95
Fixed in c7b62b5712.
Wow that was fast! I just tested it on my end, thank you for the update.
Thanks, it solved my problem.
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