errors compiling on Mac 10.13.2 (High Sierra)

+1 vote

What am I missing here? 2 compile errors after following instructions.

 

 

json/json_spirit_ubjson.cpp:358:39: error: conversion from 'size_type' (aka 'unsigned long') to 'const json_spirit::Value_impl<json_spirit::Config_vector<std::__1::basic_string<char> > >' is

      ambiguous

                    value=array_value.size();

                          ~~~~~~~~~~~~^~~~~~

./json/json_spirit_value.h:46:9: note: candidate constructor

        Value_impl( bool               value );

        ^

./json/json_spirit_value.h:47:9: note: candidate constructor

        Value_impl( int                value );

        ^

./json/json_spirit_value.h:48:9: note: candidate constructor

        Value_impl( int64_t     value );

        ^

./json/json_spirit_value.h:49:9: note: candidate constructor

        Value_impl( uint64_t    value );

        ^

./json/json_spirit_value.h:50:9: note: candidate constructor

        Value_impl( double             value );

        ^

json/json_spirit_ubjson.cpp:446:37: error: conversion from 'size_type' (aka 'unsigned long') to 'const json_spirit::Value_impl<json_spirit::Config_vector<std::__1::basic_string<char> > >' is

      ambiguous

                    value=obj_value.size();

                          ~~~~~~~~~~^~~~~~

./json/json_spirit_value.h:46:9: note: candidate constructor

        Value_impl( bool               value );

        ^

./json/json_spirit_value.h:47:9: note: candidate constructor

        Value_impl( int                value );

        ^

./json/json_spirit_value.h:48:9: note: candidate constructor

        Value_impl( int64_t     value );

        ^

./json/json_spirit_value.h:49:9: note: candidate constructor

        Value_impl( uint64_t    value );

        ^

./json/json_spirit_value.h:50:9: note: candidate constructor

        Value_impl( double             value );

        ^

1 warning and 2 errors generated.

make[1]: *** [json/libbitcoin_server_a-json_spirit_ubjson.o] Error 1

make: *** [all-recursive] Error 1

asked Dec 12, 2017 by Dan

1 Answer

0 votes
There's a branch in the repository that fixes this compilation error:

https://github.com/MultiChain/multichain/tree/1.0.x-mac-fix
answered Dec 13, 2017 by MultiChain
I replaced the file json_spirit_ubjson.cpp with the patched version.

Compilation proceeds but then I get a linker error:

Undefined symbols for architecture x86_64:
  "_ubjson_write", referenced from:
      ParseRawFormattedData(json_spirit::Value_impl<json_spirit::Config_vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const*, unsigned int*, mc_Script*, int*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libbitcoin_server.a(libbitcoin_server_a-rpcrawdata.o)
      ParseRawDetails(json_spirit::Value_impl<json_spirit::Config_vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const*, mc_Script*, mc_Script*, int*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libbitcoin_server.a(libbitcoin_server_a-rpcrawdata.o)
  "_ubjson_read", referenced from:
      mc_ExtractDetailsJSONObject(mc_EntityDetails*) in libbitcoin_server.a(libbitcoin_server_a-rpcutils.o)
      mc_ExtractDetailsJSONObject(unsigned char const*, unsigned int) in libbitcoin_server.a(libbitcoin_server_a-rpcutils.o)
      OpReturnFormatEntry(unsigned char const*, unsigned long, uint256, int, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libbitcoin_server.a(libbitcoin_server_a-rpcutils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [multichaind] Error 1
make: *** [all-recursive] Error 1
Can you please try checking out and then compiling the entire fork, so we're sure you're working to the same overall codebase as we see?
This is what I get when attempting to build on OS X using 1.0.x-mac-fix (using boost 1.55);

16 warnings generated.
  AR       libbitcoin_wallet.a
  CXX      utils/multichain_libbitcoin_multichain_a-utility.o
  CXX      utils/multichain_libbitcoin_multichain_a-systemdependent.o
  CXX      utils/multichain_libbitcoin_multichain_a-tools.o
  CXX      utils/multichain_libbitcoin_multichain_a-utilwrapper.o
In file included from utils/utilwrapper.cpp:8:
In file included from ./structs/base58.h:19:
In file included from ./keys/key.h:11:
./utils/allocators.h:15:10: fatal error: 'boost/thread/mutex.hpp' file not found
#include <boost/thread/mutex.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [utils/multichain_libbitcoin_multichain_a-utilwrapper.o] Error 1
make: *** [all-recursive] Error 1
And when using the latest boost 1.66;

2 warnings and 6 errors generated.
make[1]: *** [rpc/libbitcoin_server_a-rpcserver.o] Error 1
make: *** [all-recursive] Error 1
...