bnm bnm - 1 month ago 7
C++ Question

error building boost spirit code with in an old open sourced project

I am building an old version of voltDB on my liunx machine and I keep running into an issue with the boost spirit library. It may be possible that its a gcc version issue, any ideas welcome..


[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:63:32: error: template argument 1 is invalid
[exec] const int_parser int64_p = int_parser ();
[exec] ^
[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:63:44: error: invalid type in declaration before '=' token
[exec] const int_parser int64_p = int_parser ();
[exec] ^
[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:63:68: error: emplate argument 1 is invalid
[exec] const int_parser int64_p = int_parser ();
[exec] ^
[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:302:23: error: reference to 'int64_t' is ambiguous
[exec] void new_int( int64_t i )
[exec] ^

[exec] In file included from /usr/include/stdlib.h:314:0,
[exec] from /usr/include/c++/4.8/cstdlib:72,
[exec] from ../../third_party/cpp/boost/config/platform/linux.hpp:14,
[exec] from ../../third_party/cpp/boost/config.hpp:53,
[exec] from ../../third_party/cpp/json_spirit/json_spirit_value.h:17,
[exec] from ../../third_party/cpp/json_spirit/json_spirit_reader.h:13,
[exec] from ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:6:

[exec] /usr/include/x86_64-linux-gnu/sys/types.h:197:1: note: candidates are: typedef long int int64_t
[exec] __intN_t (64, __DI__);
[exec] ^

[exec] In file included from ../../third_party/cpp/json_spirit/json_spirit_value.h:18:0,
[exec] from ../../third_party/cpp/json_spirit/json_spirit_reader.h:13,
[exec] from ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:6:
[exec] ../../third_party/cpp/boost/cstdint.hpp:301:50: note: typedef boost::long_long_type boost::int64_t
[exec] typedef ::boost::long_long_type int64_t;
[exec] ^

[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:302:23: error: 'int64_t' has not been declared
[exec] void new_int( int64_t i )
[exec] ^

[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp: In constructor '{anonymous}::Json_grammer::definition::definition(const {anonymous}::Json_grammer&)':
[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:455:49: error: a call to a constructor cannot appear in a constant-expression
[exec] typedef function Int_action;
[exec] ^

[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:455:64: error: template argument 1 is invalid
[exec] typedef function Int_action;
[exec] ^

[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:455:76: error: invalid type in declaration before ';' token
[exec] typedef function Int_action;
[exec] ^


[exec] ../../third_party/cpp/json_spirit/json_spirit_reader.cpp:527:49: error: invalid types 'const int[Int_action {aka int}]' for array subscript
[exec] | int64_p [ new_int ]
[exec] ^

bnm bnm
Answer

I am still not sure what the exact problem was, however after playing around with gcc versions to no avail, I updated my third_party library to gcc version I knew it worked with.

Essentially updated JSON_SPIRIT Library to its last release from 4.02 which I know works with a compiler I am now using