Recently pulled some code to a new system, and I'm having some trouble compiling chrono_io and ratio_io.
I'm unsure what to change, since the errors appear to affect the preprocessor.
It seems like it must be a cross-platform compatibility issue for which the code doesn't account.
Any ideas how I can resolve these preprocessor and compiler errors?
In file included from Test.cc:12:0:
chrono_io:221:18: error: missing binary operator before token "("
#if __has_feature(cxx_rvalue_references)
^
chrono_io:789:18: error: missing binary operator before token "("
#if __has_feature(cxx_rvalue_references)
^
chrono_io:821:18: error: missing binary operator before token "("
#if __has_feature(cxx_rvalue_references)
^
chrono_io:833:18: error: missing binary operator before token "("
#if __has_feature(cxx_rvalue_references)
^
chrono_io:845:18: error: missing binary operator before token "("
#if __has_feature(cxx_rvalue_references)
^
chrono_io:858:18: error: missing binary operator before token "("
#if __has_feature(cxx_rvalue_references)
^
chrono_io:885:18: error: missing binary operator before token "("
#if __has_feature(cxx_rvalue_references)
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:36:1: error: ‘_LIBCPP_BEGIN_NAMESPACE_STD’ does not name a type
_LIBCPP_BEGIN_NAMESPACE_STD
^
ratio_io:46:1: error: ‘basic_string’ does not name a type
basic_string<_CharT>
^
ratio_io:58:8: error: ‘ratio_string’ is not a class template
struct ratio_string<atto, char>
^
ratio_io:58:21: error: ‘atto’ was not declared in this scope
struct ratio_string<atto, char>
^
ratio_io:58:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:513:47: note: ‘std::atto’
typedef ratio<1, 1000000000000000000> atto;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:59:1: error: explicit specialization of non-template ‘ratio_string’
{
^
ratio_io:60:12: error: ‘string’ does not name a type
static string symbol() {return string(1, 'a');}
^
ratio_io:61:12: error: ‘string’ does not name a type
static string prefix() {return string("atto");}
^
ratio_io:83:8: error: ‘ratio_string’ is not a class template
struct ratio_string<atto, wchar_t>
^
ratio_io:83:21: error: ‘atto’ was not declared in this scope
struct ratio_string<atto, wchar_t>
^
ratio_io:83:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:513:47: note: ‘std::atto’
typedef ratio<1, 1000000000000000000> atto;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:83:34: error: ‘ratio_string’ is not a template type
struct ratio_string<atto, wchar_t>
^
ratio_io:92:8: error: ‘ratio_string’ is not a class template
struct ratio_string<femto, char>
^
ratio_io:92:21: error: ‘femto’ was not declared in this scope
struct ratio_string<femto, char>
^
ratio_io:92:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:514:47: note: ‘std::femto’
typedef ratio<1, 1000000000000000> femto;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:92:32: error: ‘ratio_string’ is not a template type
struct ratio_string<femto, char>
^
ratio_io:117:8: error: ‘ratio_string’ is not a class template
struct ratio_string<femto, wchar_t>
^
ratio_io:117:21: error: ‘femto’ was not declared in this scope
struct ratio_string<femto, wchar_t>
^
ratio_io:117:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:514:47: note: ‘std::femto’
typedef ratio<1, 1000000000000000> femto;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:117:35: error: ‘ratio_string’ is not a template type
struct ratio_string<femto, wchar_t>
^
ratio_io:126:8: error: ‘ratio_string’ is not a class template
struct ratio_string<pico, char>
^
ratio_io:126:21: error: ‘pico’ was not declared in this scope
struct ratio_string<pico, char>
^
ratio_io:126:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:515:47: note: ‘std::pico’
typedef ratio<1, 1000000000000> pico;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:126:31: error: ‘ratio_string’ is not a template type
struct ratio_string<pico, char>
^
ratio_io:151:8: error: ‘ratio_string’ is not a class template
struct ratio_string<pico, wchar_t>
^
ratio_io:151:21: error: ‘pico’ was not declared in this scope
struct ratio_string<pico, wchar_t>
^
ratio_io:151:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:515:47: note: ‘std::pico’
typedef ratio<1, 1000000000000> pico;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:151:34: error: ‘ratio_string’ is not a template type
struct ratio_string<pico, wchar_t>
^
ratio_io:160:8: error: ‘ratio_string’ is not a class template
struct ratio_string<nano, char>
^
ratio_io:160:21: error: ‘nano’ was not declared in this scope
struct ratio_string<nano, char>
^
ratio_io:160:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:516:47: note: ‘std::nano’
typedef ratio<1, 1000000000> nano;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:160:31: error: ‘ratio_string’ is not a template type
struct ratio_string<nano, char>
^
ratio_io:185:8: error: ‘ratio_string’ is not a class template
struct ratio_string<nano, wchar_t>
^
ratio_io:185:21: error: ‘nano’ was not declared in this scope
struct ratio_string<nano, wchar_t>
^
ratio_io:185:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:516:47: note: ‘std::nano’
typedef ratio<1, 1000000000> nano;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:185:34: error: ‘ratio_string’ is not a template type
struct ratio_string<nano, wchar_t>
^
ratio_io:194:8: error: ‘ratio_string’ is not a class template
struct ratio_string<micro, char>
^
ratio_io:194:21: error: ‘micro’ was not declared in this scope
struct ratio_string<micro, char>
^
ratio_io:194:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:517:47: note: ‘std::micro’
typedef ratio<1, 1000000> micro;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:194:32: error: ‘ratio_string’ is not a template type
struct ratio_string<micro, char>
^
ratio_io:219:8: error: ‘ratio_string’ is not a class template
struct ratio_string<micro, wchar_t>
^
ratio_io:219:21: error: ‘micro’ was not declared in this scope
struct ratio_string<micro, wchar_t>
^
ratio_io:219:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:517:47: note: ‘std::micro’
typedef ratio<1, 1000000> micro;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:219:35: error: ‘ratio_string’ is not a template type
struct ratio_string<micro, wchar_t>
^
ratio_io:228:8: error: ‘ratio_string’ is not a class template
struct ratio_string<milli, char>
^
ratio_io:228:21: error: ‘milli’ was not declared in this scope
struct ratio_string<milli, char>
^
ratio_io:228:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:518:47: note: ‘std::milli’
typedef ratio<1, 1000> milli;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:228:32: error: ‘ratio_string’ is not a template type
struct ratio_string<milli, char>
^
ratio_io:253:8: error: ‘ratio_string’ is not a class template
struct ratio_string<milli, wchar_t>
^
ratio_io:253:21: error: ‘milli’ was not declared in this scope
struct ratio_string<milli, wchar_t>
^
ratio_io:253:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:518:47: note: ‘std::milli’
typedef ratio<1, 1000> milli;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:253:35: error: ‘ratio_string’ is not a template type
struct ratio_string<milli, wchar_t>
^
ratio_io:262:8: error: ‘ratio_string’ is not a class template
struct ratio_string<centi, char>
^
ratio_io:262:21: error: ‘centi’ was not declared in this scope
struct ratio_string<centi, char>
^
ratio_io:262:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:519:47: note: ‘std::centi’
typedef ratio<1, 100> centi;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:262:32: error: ‘ratio_string’ is not a template type
struct ratio_string<centi, char>
^
ratio_io:287:8: error: ‘ratio_string’ is not a class template
struct ratio_string<centi, wchar_t>
^
ratio_io:287:21: error: ‘centi’ was not declared in this scope
struct ratio_string<centi, wchar_t>
^
ratio_io:287:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:519:47: note: ‘std::centi’
typedef ratio<1, 100> centi;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:287:35: error: ‘ratio_string’ is not a template type
struct ratio_string<centi, wchar_t>
^
ratio_io:296:8: error: ‘ratio_string’ is not a class template
struct ratio_string<deci, char>
^
ratio_io:296:21: error: ‘deci’ was not declared in this scope
struct ratio_string<deci, char>
^
ratio_io:296:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:520:47: note: ‘std::deci’
typedef ratio<1, 10> deci;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:296:31: error: ‘ratio_string’ is not a template type
struct ratio_string<deci, char>
^
ratio_io:321:8: error: ‘ratio_string’ is not a class template
struct ratio_string<deci, wchar_t>
^
ratio_io:321:21: error: ‘deci’ was not declared in this scope
struct ratio_string<deci, wchar_t>
^
ratio_io:321:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:520:47: note: ‘std::deci’
typedef ratio<1, 10> deci;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:321:34: error: ‘ratio_string’ is not a template type
struct ratio_string<deci, wchar_t>
^
ratio_io:330:8: error: ‘ratio_string’ is not a class template
struct ratio_string<deca, char>
^
ratio_io:330:21: error: ‘deca’ was not declared in this scope
struct ratio_string<deca, char>
^
ratio_io:330:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:521:47: note: ‘std::deca’
typedef ratio< 10, 1> deca;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:330:31: error: ‘ratio_string’ is not a template type
struct ratio_string<deca, char>
^
ratio_io:355:8: error: ‘ratio_string’ is not a class template
struct ratio_string<deca, wchar_t>
^
ratio_io:355:21: error: ‘deca’ was not declared in this scope
struct ratio_string<deca, wchar_t>
^
ratio_io:355:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:521:47: note: ‘std::deca’
typedef ratio< 10, 1> deca;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:355:34: error: ‘ratio_string’ is not a template type
struct ratio_string<deca, wchar_t>
^
ratio_io:364:8: error: ‘ratio_string’ is not a class template
struct ratio_string<hecto, char>
^
ratio_io:364:21: error: ‘hecto’ was not declared in this scope
struct ratio_string<hecto, char>
^
ratio_io:364:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:522:47: note: ‘std::hecto’
typedef ratio< 100, 1> hecto;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:364:32: error: ‘ratio_string’ is not a template type
struct ratio_string<hecto, char>
^
ratio_io:389:8: error: ‘ratio_string’ is not a class template
struct ratio_string<hecto, wchar_t>
^
ratio_io:389:21: error: ‘hecto’ was not declared in this scope
struct ratio_string<hecto, wchar_t>
^
ratio_io:389:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:522:47: note: ‘std::hecto’
typedef ratio< 100, 1> hecto;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:389:35: error: ‘ratio_string’ is not a template type
struct ratio_string<hecto, wchar_t>
^
ratio_io:398:8: error: ‘ratio_string’ is not a class template
struct ratio_string<kilo, char>
^
ratio_io:398:21: error: ‘kilo’ was not declared in this scope
struct ratio_string<kilo, char>
^
ratio_io:398:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:523:47: note: ‘std::kilo’
typedef ratio< 1000, 1> kilo;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:398:31: error: ‘ratio_string’ is not a template type
struct ratio_string<kilo, char>
^
ratio_io:423:8: error: ‘ratio_string’ is not a class template
struct ratio_string<kilo, wchar_t>
^
ratio_io:423:21: error: ‘kilo’ was not declared in this scope
struct ratio_string<kilo, wchar_t>
^
ratio_io:423:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:523:47: note: ‘std::kilo’
typedef ratio< 1000, 1> kilo;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:423:34: error: ‘ratio_string’ is not a template type
struct ratio_string<kilo, wchar_t>
^
ratio_io:432:8: error: ‘ratio_string’ is not a class template
struct ratio_string<mega, char>
^
ratio_io:432:21: error: ‘mega’ was not declared in this scope
struct ratio_string<mega, char>
^
ratio_io:432:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:524:47: note: ‘std::mega’
typedef ratio< 1000000, 1> mega;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:432:31: error: ‘ratio_string’ is not a template type
struct ratio_string<mega, char>
^
ratio_io:457:8: error: ‘ratio_string’ is not a class template
struct ratio_string<mega, wchar_t>
^
ratio_io:457:21: error: ‘mega’ was not declared in this scope
struct ratio_string<mega, wchar_t>
^
ratio_io:457:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:524:47: note: ‘std::mega’
typedef ratio< 1000000, 1> mega;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:457:34: error: ‘ratio_string’ is not a template type
struct ratio_string<mega, wchar_t>
^
ratio_io:466:8: error: ‘ratio_string’ is not a class template
struct ratio_string<giga, char>
^
ratio_io:466:21: error: ‘giga’ was not declared in this scope
struct ratio_string<giga, char>
^
ratio_io:466:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:525:47: note: ‘std::giga’
typedef ratio< 1000000000, 1> giga;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:466:31: error: ‘ratio_string’ is not a template type
struct ratio_string<giga, char>
^
ratio_io:491:8: error: ‘ratio_string’ is not a class template
struct ratio_string<giga, wchar_t>
^
ratio_io:491:21: error: ‘giga’ was not declared in this scope
struct ratio_string<giga, wchar_t>
^
ratio_io:491:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:525:47: note: ‘std::giga’
typedef ratio< 1000000000, 1> giga;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:491:34: error: ‘ratio_string’ is not a template type
struct ratio_string<giga, wchar_t>
^
ratio_io:500:8: error: ‘ratio_string’ is not a class template
struct ratio_string<tera, char>
^
ratio_io:500:21: error: ‘tera’ was not declared in this scope
struct ratio_string<tera, char>
^
ratio_io:500:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:526:47: note: ‘std::tera’
typedef ratio< 1000000000000, 1> tera;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:500:31: error: ‘ratio_string’ is not a template type
struct ratio_string<tera, char>
^
ratio_io:525:8: error: ‘ratio_string’ is not a class template
struct ratio_string<tera, wchar_t>
^
ratio_io:525:21: error: ‘tera’ was not declared in this scope
struct ratio_string<tera, wchar_t>
^
ratio_io:525:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:526:47: note: ‘std::tera’
typedef ratio< 1000000000000, 1> tera;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:525:34: error: ‘ratio_string’ is not a template type
struct ratio_string<tera, wchar_t>
^
ratio_io:534:8: error: ‘ratio_string’ is not a class template
struct ratio_string<peta, char>
^
ratio_io:534:21: error: ‘peta’ was not declared in this scope
struct ratio_string<peta, char>
^
ratio_io:534:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:527:47: note: ‘std::peta’
typedef ratio< 1000000000000000, 1> peta;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:534:31: error: ‘ratio_string’ is not a template type
struct ratio_string<peta, char>
^
ratio_io:559:8: error: ‘ratio_string’ is not a class template
struct ratio_string<peta, wchar_t>
^
ratio_io:559:21: error: ‘peta’ was not declared in this scope
struct ratio_string<peta, wchar_t>
^
ratio_io:559:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:527:47: note: ‘std::peta’
typedef ratio< 1000000000000000, 1> peta;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:559:34: error: ‘ratio_string’ is not a template type
struct ratio_string<peta, wchar_t>
^
ratio_io:568:8: error: ‘ratio_string’ is not a class template
struct ratio_string<exa, char>
^
ratio_io:568:21: error: ‘exa’ was not declared in this scope
struct ratio_string<exa, char>
^
ratio_io:568:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:528:47: note: ‘std::exa’
typedef ratio< 1000000000000000000, 1> exa;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:568:30: error: ‘ratio_string’ is not a template type
struct ratio_string<exa, char>
^
ratio_io:593:8: error: ‘ratio_string’ is not a class template
struct ratio_string<exa, wchar_t>
^
ratio_io:593:21: error: ‘exa’ was not declared in this scope
struct ratio_string<exa, wchar_t>
^
ratio_io:593:21: note: suggested alternative:
In file included from /usr/include/c++/4.8.2/chrono:38:0,
from Test.cc:11:
/usr/include/c++/4.8.2/ratio:528:47: note: ‘std::exa’
typedef ratio< 1000000000000000000, 1> exa;
^
In file included from chrono_io:139:0,
from Test.cc:12:
ratio_io:593:33: error: ‘ratio_string’ is not a template type
struct ratio_string<exa, wchar_t>
^
ratio_io:599:1: error: ‘_LIBCPP_END_NAMESPACE_STD’ does not name a type
_LIBCPP_END_NAMESPACE_STD
^
In file included from Test.cc:12:0:
chrono_io:1164:1: error: ‘_LIBCPP_END_NAMESPACE_STD’ does not name a type
_LIBCPP_END_NAMESPACE_STD
^
Test.cc: In function ‘void RealDataTest()’:
Test.cc:167:12: error: cannot bind ‘std::basic_ostream<char>’ lvalue to ‘std::basic_ostream<char>&&’
std::cout << "Time for n->mostRecent: " << (Clock::now() - start) << std::endl;
^
In file included from /usr/include/c++/4.8.2/iostream:39:0,
from Nearby.cc:9,
from Test.cc:5:
/usr/include/c++/4.8.2/ostream:602:5: error: initializing argument 1 of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = std::chrono::duration<long int, std::ratio<1l, 1000000000l> >]’
operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
^
Test.cc:185:12: error: cannot bind ‘std::basic_ostream<char>’ lvalue to ‘std::basic_ostream<char>&&’
std::cout << "Time for n->deletePost: " << (Clock::now() - start) << std::endl;
^
In file included from /usr/include/c++/4.8.2/iostream:39:0,
from Nearby.cc:9,
from Test.cc:5:
/usr/include/c++/4.8.2/ostream:602:5: error: initializing argument 1 of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = std::chrono::duration<long int, std::ratio<1l, 1000000000l> >]’
operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
^
make: *** [all] Error 1
I haven't played with this code in several years. It is using:
#if __has_feature(cxx_rvalue_references)
__seconds_(std::move(__seconds)),
...
to check if the compiler supports rvalue references (C++11 move semantics). My recommendation is to assume that you have C++11 (since you have to have <chrono> and just remove the __has_feature and the #else branch.
If for some reason you have to support a compiler which doesn't have rvalue references you can:
#define __has_feature(x) 0
and this will select the #else branch everywhere.
__has_feature(cxx_rvalue_references) is a clang extension.
Update
Update to this library.
https://howardhinnant.github.io/date/chrono_io.html
It has been simplified to only streaming durations.
Related
The G++ complier is not working. Yesterday I was updating MinGW and Windows PATHS to get Natbeans working but now Visual Studio Code is not Saying "Hello World", It is giving 20+ errors each run.
Any ideas on how to fix so I can run my program? I Uninstalled and Reinstalled MinGw twice but it did not work
Some of the Errors:
required from 'class std::__cxx11::basic_string<char16_t>'
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\basic_string.h:5677:41:
required from here
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext\alloc_traits.h:61:53:
error: no type named 'size_type' in 'struct
std::allocator_traitsstd::allocator<char16_t >'
typedef typename _Base_type::size_type size_type;
^~~~~~~~~ c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext\alloc_traits.h:62:53:
error: no type named 'difference_type' in 'struct
std::allocator_traitsstd::allocator<char16_t >'
typedef typename _Base_type::difference_type difference_type;
^~~~~~~~~~~~~~~ c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext\alloc_traits.h:70:23:
error: no members matching
'__gnu_cxx::__alloc_traitsstd::allocator<char16_t >::_Base_type {aka
std::allocator_traitsstd::allocator<char16_t >}::max_size' in
'__gnu_cxx::__alloc_traitsstd::allocator<char16_t >::_Base_type {aka
struct std::allocator_traitsstd::allocator<char16_t >}'
using _Base_type::max_size;
^~~~~~~~ In file included from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\string:52:0,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\iostream:39,
from test17.cpp:23: c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\basic_string.h: In
member function 'size_t std::hashstd::__cxx11::basic_string<char16_t
::operator()(const u16string&) const': c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\basic_string.h:5678:42:
error: 'const u16string {aka const class
std::__cxx11::basic_string<char16_t>}' has no member named 'length'
__s.length() * sizeof(char16_t)); }
^~~~~~ In file included from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\basic_string.h:40:0,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\string:52,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\iostream:39,
from test17.cpp:23: c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext\alloc_traits.h: In
instantiation of 'struct
__gnu_cxx::__alloc_traitsstd::allocator<char32_t >': c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\basic_string.h:75:24:
required from 'class std::__cxx11::basic_string<char32_t>'
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\basic_string.h:5692:41:
required from here
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext\alloc_traits.h:61:53:
error: no type named 'size_type' in 'struct
std::allocator_traitsstd::allocator<char32_t >'
typedef typename _Base_type::size_type size_type;
^~~~~~~~~ c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext\alloc_traits.h:62:53:
error: no type named 'difference_type' in 'struct
std::allocator_traitsstd::allocator<char32_t >'
typedef typename _Base_type::difference_type difference_type;
^~~~~~~~~~~~~~~ c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext\alloc_traits.h:70:23:
error: no members matching
'__gnu_cxx::__alloc_traitsstd::allocator<char32_t >::_Base_type {aka
std::allocator_traitsstd::allocator<char32_t >}::max_size' in
'__gnu_cxx::__alloc_traitsstd::allocator<char32_t >::_Base_type {aka
struct std::allocator_traitsstd::allocator<char32_t >}'
using _Base_type::max_size;
^~~~~~~~ In file included from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\string:52:0,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\iostream:39,
from test17.cpp:23: c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\basic_string.h: In
member function 'size_t std::hashstd::__cxx11::basic_string<char32_t
::operator()(const u32string&) const': c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\basic_string.h:5693:42:
error: 'const u32string {aka const class
std::__cxx11::basic_string<char32_t>}' has no member named 'length'
The Code so far (Want it to print Hello World to the Console using C++):
#include <iostream>
int main()
{
//Prints Hello World to the Console
std::cout << "Hello World" << std::endl;
}
Desired output:
"Hello World"
I have a header file called transaction_gen.h and a corresponding cpp file called transaction_gen.cpp.
Here is what I have in transaction_gen.h
#ifndef BITCOIN_TEST_GEN_TRANSACTION_GEN_H
#define BITCOIN_TEST_GEN_TRANSACTION_GEN_H
#include <rapidcheck/gen/Arbitrary.h>
#include <rapidcheck/Gen.h>
#include "primitives/transaction.h"
#include "script/script.h"
#include "amount.h"
#include "test/gen/script_gen.h"
#include "test/gen/crypto_gen.h"
namespace rc {
template<>
struct Arbitrary<COutPoint> {
static Gen<COutPoint> arbitrary() {
return gen::map(gen::tuple(gen::arbitrary<uint256>(), gen::arbitrary<uint32_t>()), [](std::tuple<uint256, uint32_t> outPointPrimitives) {
uint32_t nIn;
uint256 nHashIn;
std::tie(nHashIn, nIn) = outPointPrimitives;
return COutPoint(nHashIn, nIn);
});
};
};
template<>
struct Arbitrary<CTxIn> {
static Gen<CTxIn> arbitrary() {
return gen::map(gen::tuple(gen::arbitrary<COutPoint>(), gen::arbitrary<CScript>(), gen::arbitrary<uint32_t>()), [](std::tuple<COutPoint, CScript, uint32_t> txInPrimitives) {
COutPoint outpoint;
CScript script;
uint32_t sequence;
std::tie(outpoint,script,sequence) = txInPrimitives;
return CTxIn(outpoint,script,sequence);
});
};
};
/** Generates one or more inputs */
Gen<std::vector<CTxIn>> oneOrMoreInputs();
template<>
struct Arbitrary<CAmount> {
static Gen<CAmount> arbitrary() {
//why doesn't this generator call work? It seems to cause an infinite loop.
//return gen::arbitrary<int64_t>();
return gen::inRange(std::numeric_limits<int64_t>::min(),std::numeric_limits<int64_t>::max());
};
};
template<>
struct Arbitrary<CTxOut> {
static Gen<CTxOut> arbitrary() {
return gen::map(gen::tuple(gen::arbitrary<CAmount>(), gen::arbitrary<CScript>()), [](std::tuple<CAmount, CScript> txOutPrimitives) {
CAmount amount;
CScript script;
std::tie(amount,script) = txOutPrimitives;
return CTxOut(amount,script);
});
};
};
and here is what I have in the corresponding cpp file
#include <rapidcheck/gen/Arbitrary.h>
#include <rapidcheck/Gen.h>
#include "primitives/transaction.h"
#include "script/script.h"
#include "amount.h"
#include "test/gen/transaction_gen.h"
namespace rc {
/** Generates one or more inputs */
Gen<std::vector<CTxIn>> oneOrMoreInputs() {
return gen::suchThat(gen::arbitrary<std::vector<CTxIn>>(), [](std::vector<CTxIn> vin) {
return vin.size() > 0;
});
}
/** Generates one or more outputs */
Gen<std::vector<CTxOut>> oneOrMoreOutputs() {
return gen::suchThat(gen::arbitrary<std::vector<CTxOut>>(), [](std::vector<CTxOut> vout) {
return vout.size() > 0;
});
}
}
and this will compile fine when I build my program.
However, since I want to be using functionality located in transaction_gen.h I obviously want to include it in my program. However, when I include it I get a long nasty error message:
chris#chris-870Z5E-880Z5E-680Z5E:~/.../src/test$ make
make -C .. bitcoin_test
make[1]: Entering directory `/home/chris/dev/bitcoin/src'
CXX test/test_test_bitcoin-transaction_properties.o
CXX test/gen/test_test_bitcoin-transaction_gen.o
In file included from ./test/gen/script_gen.h:6:0,
from ./test/gen/transaction_gen.h:9,
from test/gen/transaction_gen.cpp:8:
./test/gen/crypto_gen.h: In static member function ‘static rc::Gen<CKey> rc::Arbitrary<CKey>::arbitrary()’:
./test/gen/crypto_gen.h:19:8: error: no matching function for call to ‘map(rc::Arbitrary<CKey>::arbitrary()::<lambda(int)>)’
});
^
In file included from /usr/local/include/rapidcheck/Gen.h:74:0,
from /usr/local/include/rapidcheck/gen/Arbitrary.h:3,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/Gen.hpp:15:54: note: candidate: template<class T, class Mapper> rc::Gen<typename std::decay<typename std::result_of<Mapper(T)>::type>::type> rc::gen::map(rc::Gen<T>, Mapper&&)
Gen<Decay<typename std::result_of<Mapper(T)>::type>> map(Gen<T> gen,
^
/usr/local/include/rapidcheck/Gen.hpp:15:54: note: template argument deduction/substitution failed:
In file included from ./test/gen/script_gen.h:6:0,
from ./test/gen/transaction_gen.h:9,
from test/gen/transaction_gen.cpp:8:
./test/gen/crypto_gen.h:19:8: note: candidate expects 2 arguments, 1 provided
});
^
./test/gen/crypto_gen.h: In static member function ‘static rc::Gen<std::vector<unsigned char, secure_allocator<unsigned char> > > rc::Arbitrary<std::vector<unsigned char, secure_allocator<unsigned char> > >::arbitrary()’:
./test/gen/crypto_gen.h:29:8: error: no matching function for call to ‘map(rc::Arbitrary<std::vector<unsigned char, secure_allocator<unsigned char> > >::arbitrary()::<lambda(CKey)>)’
});
^
In file included from /usr/local/include/rapidcheck/Gen.h:74:0,
from /usr/local/include/rapidcheck/gen/Arbitrary.h:3,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/Gen.hpp:15:54: note: candidate: template<class T, class Mapper> rc::Gen<typename std::decay<typename std::result_of<Mapper(T)>::type>::type> rc::gen::map(rc::Gen<T>, Mapper&&)
Gen<Decay<typename std::result_of<Mapper(T)>::type>> map(Gen<T> gen,
^
/usr/local/include/rapidcheck/Gen.hpp:15:54: note: template argument deduction/substitution failed:
In file included from ./test/gen/script_gen.h:6:0,
from ./test/gen/transaction_gen.h:9,
from test/gen/transaction_gen.cpp:8:
./test/gen/crypto_gen.h:29:8: note: candidate expects 2 arguments, 1 provided
});
^
./test/gen/crypto_gen.h: In static member function ‘static rc::Gen<CPubKey> rc::Arbitrary<CPubKey>::arbitrary()’:
./test/gen/crypto_gen.h:39:8: error: no matching function for call to ‘map(rc::Arbitrary<CPubKey>::arbitrary()::<lambda(CKey)>)’
});
^
In file included from /usr/local/include/rapidcheck/Gen.h:74:0,
from /usr/local/include/rapidcheck/gen/Arbitrary.h:3,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/Gen.hpp:15:54: note: candidate: template<class T, class Mapper> rc::Gen<typename std::decay<typename std::result_of<Mapper(T)>::type>::type> rc::gen::map(rc::Gen<T>, Mapper&&)
Gen<Decay<typename std::result_of<Mapper(T)>::type>> map(Gen<T> gen,
^
/usr/local/include/rapidcheck/Gen.hpp:15:54: note: template argument deduction/substitution failed:
In file included from ./test/gen/script_gen.h:6:0,
from ./test/gen/transaction_gen.h:9,
from test/gen/transaction_gen.cpp:8:
./test/gen/crypto_gen.h:39:8: note: candidate expects 2 arguments, 1 provided
});
^
./test/gen/crypto_gen.h: In static member function ‘static rc::Gen<uint256> rc::Arbitrary<uint256>::arbitrary()’:
./test/gen/crypto_gen.h:49:8: error: no matching function for call to ‘map(rc::Arbitrary<uint256>::arbitrary()::<lambda(int)>)’
});
^
In file included from /usr/local/include/rapidcheck/Gen.h:74:0,
from /usr/local/include/rapidcheck/gen/Arbitrary.h:3,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/Gen.hpp:15:54: note: candidate: template<class T, class Mapper> rc::Gen<typename std::decay<typename std::result_of<Mapper(T)>::type>::type> rc::gen::map(rc::Gen<T>, Mapper&&)
Gen<Decay<typename std::result_of<Mapper(T)>::type>> map(Gen<T> gen,
^
/usr/local/include/rapidcheck/Gen.hpp:15:54: note: template argument deduction/substitution failed:
In file included from ./test/gen/script_gen.h:6:0,
from ./test/gen/transaction_gen.h:9,
from test/gen/transaction_gen.cpp:8:
./test/gen/crypto_gen.h:49:8: note: candidate expects 2 arguments, 1 provided
});
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp: In instantiation of ‘struct rc::Arbitrary<std::vector<unsigned char> >’:
/usr/local/include/rapidcheck/gen/Arbitrary.h:17:33: required by substitution of ‘template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary() [with T = std::vector<unsigned char>]’
./test/gen/script_gen.h:13:66: required from here
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:22:62: error: incomplete type ‘rc::gen::detail::DefaultArbitrary<std::vector<unsigned char> >’ used in nested name specifier
static decltype(gen::detail::DefaultArbitrary<T>::arbitrary()) arbitrary() {
^
In file included from ./test/gen/transaction_gen.h:9:0,
from test/gen/transaction_gen.cpp:8:
./test/gen/script_gen.h: In static member function ‘static rc::Gen<CScript> rc::Arbitrary<CScript>::arbitrary()’:
./test/gen/script_gen.h:13:66: error: no matching function for call to ‘arbitrary()’
return gen::map(gen::arbitrary<std::vector<unsigned char>>(), [](std::vector<unsigned char> script) {
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: candidate: template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary()
decltype(Arbitrary<T>::arbitrary()) arbitrary() {
^
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: substitution of deduced template arguments resulted in errors seen above
In file included from test/gen/transaction_gen.cpp:8:0:
./test/gen/transaction_gen.h: In static member function ‘static rc::Gen<COutPoint> rc::Arbitrary<COutPoint>::arbitrary()’:
./test/gen/transaction_gen.h:17:23: error: ‘tuple’ is not a member of ‘rc::gen’
return gen::map(gen::tuple(gen::arbitrary<uint256>(), gen::arbitrary<uint32_t>()), [](std::tuple<uint256, uint32_t> outPointPrimitives) {
^
./test/gen/transaction_gen.h:17:23: note: suggested alternative:
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/memory:62,
from /usr/local/include/rapidcheck/Seq.h:4,
from /usr/local/include/rapidcheck/Shrinkable.h:3,
from /usr/local/include/rapidcheck/Gen.h:4,
from /usr/local/include/rapidcheck/gen/Arbitrary.h:3,
from test/gen/transaction_gen.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:83:11: note: ‘std::tuple’
class tuple;
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp: In instantiation of ‘struct rc::Arbitrary<unsigned int>’:
/usr/local/include/rapidcheck/gen/Arbitrary.h:17:33: required by substitution of ‘template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary() [with T = unsigned int]’
./test/gen/transaction_gen.h:17:86: required from here
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:22:62: error: incomplete type ‘rc::gen::detail::DefaultArbitrary<unsigned int>’ used in nested name specifier
static decltype(gen::detail::DefaultArbitrary<T>::arbitrary()) arbitrary() {
^
In file included from test/gen/transaction_gen.cpp:8:0:
./test/gen/transaction_gen.h:17:86: error: no matching function for call to ‘arbitrary()’
return gen::map(gen::tuple(gen::arbitrary<uint256>(), gen::arbitrary<uint32_t>()), [](std::tuple<uint256, uint32_t> outPointPrimitives) {
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: candidate: template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary()
decltype(Arbitrary<T>::arbitrary()) arbitrary() {
^
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: substitution of deduced template arguments resulted in errors seen above
In file included from test/gen/transaction_gen.cpp:8:0:
./test/gen/transaction_gen.h: In static member function ‘static rc::Gen<CTxIn> rc::Arbitrary<CTxIn>::arbitrary()’:
./test/gen/transaction_gen.h:30:23: error: ‘tuple’ is not a member of ‘rc::gen’
return gen::map(gen::tuple(gen::arbitrary<COutPoint>(), gen::arbitrary<CScript>(), gen::arbitrary<uint32_t>()), [](std::tuple<COutPoint, CScript, uint32_t> txInPrimitives) {
^
./test/gen/transaction_gen.h:30:23: note: suggested alternative:
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/memory:62,
from /usr/local/include/rapidcheck/Seq.h:4,
from /usr/local/include/rapidcheck/Shrinkable.h:3,
from /usr/local/include/rapidcheck/Gen.h:4,
from /usr/local/include/rapidcheck/gen/Arbitrary.h:3,
from test/gen/transaction_gen.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:83:11: note: ‘std::tuple’
class tuple;
^
In file included from test/gen/transaction_gen.cpp:8:0:
./test/gen/transaction_gen.h:30:115: error: no matching function for call to ‘arbitrary()’
return gen::map(gen::tuple(gen::arbitrary<COutPoint>(), gen::arbitrary<CScript>(), gen::arbitrary<uint32_t>()), [](std::tuple<COutPoint, CScript, uint32_t> txInPrimitives) {
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: candidate: template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary()
decltype(Arbitrary<T>::arbitrary()) arbitrary() {
^
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: template argument deduction/substitution failed:
In file included from test/gen/transaction_gen.cpp:1:0:
/usr/local/include/rapidcheck/gen/Arbitrary.h: In substitution of ‘template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary() [with T = unsigned int]’:
./test/gen/transaction_gen.h:30:115: required from here
/usr/local/include/rapidcheck/gen/Arbitrary.h:17:33: error: ‘arbitrary’ is not a member of ‘rc::Arbitrary<unsigned int>’
decltype(Arbitrary<T>::arbitrary()) arbitrary();
^
In file included from test/gen/transaction_gen.cpp:8:0:
./test/gen/transaction_gen.h: In static member function ‘static rc::Gen<long int> rc::Arbitrary<long int>::arbitrary()’:
./test/gen/transaction_gen.h:48:14: error: ‘inRange’ is not a member of ‘rc::gen’
return gen::inRange(std::numeric_limits<int64_t>::min(),std::numeric_limits<int64_t>::max());
^
./test/gen/transaction_gen.h: In static member function ‘static rc::Gen<CTxOut> rc::Arbitrary<CTxOut>::arbitrary()’:
./test/gen/transaction_gen.h:55:23: error: ‘tuple’ is not a member of ‘rc::gen’
return gen::map(gen::tuple(gen::arbitrary<CAmount>(), gen::arbitrary<CScript>()), [](std::tuple<CAmount, CScript> txOutPrimitives) {
^
./test/gen/transaction_gen.h:55:23: note: suggested alternative:
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/memory:62,
from /usr/local/include/rapidcheck/Seq.h:4,
from /usr/local/include/rapidcheck/Shrinkable.h:3,
from /usr/local/include/rapidcheck/Gen.h:4,
from /usr/local/include/rapidcheck/gen/Arbitrary.h:3,
from test/gen/transaction_gen.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:83:11: note: ‘std::tuple’
class tuple;
^
test/gen/transaction_gen.cpp: In function ‘rc::Gen<std::vector<CTxIn> > rc::oneOrMoreInputs()’:
test/gen/transaction_gen.cpp:14:12: error: ‘suchThat’ is not a member of ‘rc::gen’
return gen::suchThat(gen::arbitrary<std::vector<CTxIn>>(), [](std::vector<CTxIn> vin) {
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp: In instantiation of ‘struct rc::Arbitrary<std::vector<CTxIn> >’:
/usr/local/include/rapidcheck/gen/Arbitrary.h:17:33: required by substitution of ‘template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary() [with T = std::vector<CTxIn>]’
test/gen/transaction_gen.cpp:14:61: required from here
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:22:62: error: incomplete type ‘rc::gen::detail::DefaultArbitrary<std::vector<CTxIn> >’ used in nested name specifier
static decltype(gen::detail::DefaultArbitrary<T>::arbitrary()) arbitrary() {
^
test/gen/transaction_gen.cpp:14:61: error: no matching function for call to ‘arbitrary()’
return gen::suchThat(gen::arbitrary<std::vector<CTxIn>>(), [](std::vector<CTxIn> vin) {
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: candidate: template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary()
decltype(Arbitrary<T>::arbitrary()) arbitrary() {
^
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: substitution of deduced template arguments resulted in errors seen above
test/gen/transaction_gen.cpp: In function ‘rc::Gen<std::vector<CTxOut> > rc::oneOrMoreOutputs()’:
test/gen/transaction_gen.cpp:21:12: error: ‘suchThat’ is not a member of ‘rc::gen’
return gen::suchThat(gen::arbitrary<std::vector<CTxOut>>(), [](std::vector<CTxOut> vout) {
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp: In instantiation of ‘struct rc::Arbitrary<std::vector<CTxOut> >’:
/usr/local/include/rapidcheck/gen/Arbitrary.h:17:33: required by substitution of ‘template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary() [with T = std::vector<CTxOut>]’
test/gen/transaction_gen.cpp:21:62: required from here
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:22:62: error: incomplete type ‘rc::gen::detail::DefaultArbitrary<std::vector<CTxOut> >’ used in nested name specifier
static decltype(gen::detail::DefaultArbitrary<T>::arbitrary()) arbitrary() {
^
test/gen/transaction_gen.cpp:21:62: error: no matching function for call to ‘arbitrary()’
return gen::suchThat(gen::arbitrary<std::vector<CTxOut>>(), [](std::vector<CTxOut> vout) {
^
In file included from /usr/local/include/rapidcheck/gen/Arbitrary.h:22:0,
from test/gen/transaction_gen.cpp:1:
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: candidate: template<class T> decltype (rc::Arbitrary<T>::arbitrary()) rc::gen::arbitrary()
decltype(Arbitrary<T>::arbitrary()) arbitrary() {
^
/usr/local/include/rapidcheck/gen/Arbitrary.hpp:13:37: note: substitution of deduced template arguments resulted in errors seen above
make[1]: *** [test/gen/test_test_bitcoin-transaction_gen.o] Error 1
make[1]: Leaving directory `/home/chris/dev/bitcoin/src'
make: *** [all] Error 2
and I'm not really sure why this is happening. It almost seems like when I include transaction_gen.h it erases all other header files I had included, this the problems like
In file included from ./test/gen/script_gen.h:6:0,
from ./test/gen/transaction_gen.h:9,
from test/gen/transaction_gen.cpp:8:
./test/gen/crypto_gen.h: In static member function ‘static rc::Gen<CKey> rc::Arbitrary<CKey>::arbitrary()’:
./test/gen/crypto_gen.h:19:8: error: no matching function for call to ‘map(rc::Arbitrary<CKey>::arbitrary()::<lambda(int)>)’
});
because this obviously is included properly when I exclude transaction_gen.h. Where am I going wrong here? I feel like this is a pretty simple fix but I've spent a couple hours on it now to avail :/
EDIT: I've pushed this up to github
Here is transaction_gen.h
Here is transaction_gen.cpp
Try remove these lines from transaction_gen.cpp:
#include <rapidcheck/gen/Arbitrary.h>
#include <rapidcheck/Gen.h>
#include "primitives/transaction.h"
#include "script/script.h"
#include "amount.h"
Keep this #include line only:
#include "test/gen/transaction_gen.h"
Your transaction_gen.h is missing a #endif at the end of the file.
Include these in your cpp file also
#include "test/gen/script_gen.h"
#include "test/gen/crypto_gen.h"
I am getting this error when I try to use my project/module in my GOOGLE TESTS.
gcc.compile.c++ bin/gcc-4.8.3/debug/link-static/gmock_test.o
In file included from /usr/include/c++/4.8.2/tr1/functional:39:0,
from /usr/local/include/google/dense_hash_map:106,
from sagarmatha/utils/include/multicast_receiver.h:11,
from include/transmitter/mcx_receiver.h:25,
from src/unit_tests_theo.cpp:7:
/usr/include/c++/4.8.2/tr1/tuple:130:11: error: redefinition of ‘class std::tuple< <template-parameter-1-1> >’
class tuple : public _Tuple_impl<0, _Elements...>
^
In file included from /usr/include/c++/4.8.2/bits/stl_map.h:63:0,
from /usr/include/c++/4.8.2/map:61,
from 8k/include/Source.h:12,
from src/unit_tests_theo.cpp:2:
/usr/include/c++/4.8.2/tuple:388:11: error: previous definition of ‘class std::tuple< <template-parameter-1-1> >’
class tuple : public _Tuple_impl<0, _Elements...>
^
In file included from /usr/include/c++/4.8.2/tr1/functional:39:0,
from /usr/local/include/google/dense_hash_map:106,
from sagarmatha/utils/include/multicast_receiver.h:11,
from include/transmitter/mcx_receiver.h:25,
from src/unit_tests_theo.cpp:7:
/usr/include/c++/4.8.2/tr1/tuple:164:20: error: redefinition of ‘class std::tuple<>’
template<> class tuple<> { };
^
In file included from /usr/include/c++/4.8.2/bits/stl_map.h:63:0,
from /usr/include/c++/4.8.2/map:61,
from 8k/include/Source.h:12,
from src/unit_tests_theo.cpp:2:
/usr/include/c++/4.8.2/tuple:512:11: error: previous definition of ‘class std::tuple<>’
class tuple<>
^
In file included from /usr/include/c++/4.8.2/tr1/functional:39:0,
from /usr/local/include/google/dense_hash_map:106,
from sagarmatha/utils/include/multicast_receiver.h:11,
from include/transmitter/mcx_receiver.h:25,
from src/unit_tests_theo.cpp:7:
/usr/include/c++/4.8.2/tr1/tuple:168:11: error: redefinition of ‘class std::tuple<_T1, _T2>’
class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
^
In file included from /usr/include/c++/4.8.2/bits/stl_map.h:63:0,
from /usr/include/c++/4.8.2/map:61,
from 8k/include/Source.h:12,
from src/unit_tests_theo.cpp:2:
/usr/include/c++/4.8.2/tuple:521:11: error: previous definition of ‘class std::tuple<_T1, _T2>’
class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
^
In file included from /usr/include/c++/4.8.2/tuple:38:0,
from /usr/include/c++/4.8.2/bits/stl_map.h:63,
from /usr/include/c++/4.8.2/map:61,
from 8k/include/Source.h:12,
from src/unit_tests_theo.cpp:2:
/usr/include/c++/4.8.2/utility:83:24: error: template parameter ‘long unsigned int _Int’
template<std::size_t _Int, class _Tp>
^
In file included from /usr/include/c++/4.8.2/tr1/functional:39:0,
from /usr/local/include/google/dense_hash_map:106,
from sagarmatha/utils/include/multicast_receiver.h:11,
from include/transmitter/mcx_receiver.h:25,
from src/unit_tests_theo.cpp:7:
/usr/include/c++/4.8.2/tr1/tuple:223:12: error: redeclared here as ‘int __i’
struct tuple_element;
^
/usr/include/c++/4.8.2/tr1/tuple:230:12: error: specialization of ‘template<long unsigned int _Int, class _Tp> struct std::tuple_element’ in different namespace [-fpermissive]
struct tuple_element<__i, tuple<_Head, _Tail...> >
^
In file included from /usr/include/c++/4.8.2/tuple:38:0,
from /usr/include/c++/4.8.2/bits/stl_map.h:63,
from /usr/include/c++/4.8.2/map:61,
from 8k/include/Source.h:12,
from src/unit_tests_theo.cpp:2:
/usr/include/c++/4.8.2/utility:84:11: error: from definition of ‘template<long unsigned int _Int, class _Tp> struct std::tuple_element’ [-fpermissive]
class tuple_element;
^
In file included from /usr/include/c++/4.8.2/tr1/functional:39:0,
from /usr/local/include/google/dense_hash_map:106,
from sagarmatha/utils/include/multicast_receiver.h:11,
from include/transmitter/mcx_receiver.h:25,
from src/unit_tests_theo.cpp:7:
/usr/include/c++/4.8.2/tr1/tuple:237:12: error: redefinition of ‘struct std::tuple_element<0ul, std::tuple<_El0, _El ...> >’
struct tuple_element<0, tuple<_Head, _Tail...> >
^
In file included from /usr/include/c++/4.8.2/bits/stl_map.h:63:0,
from /usr/include/c++/4.8.2/map:61,
from 8k/include/Source.h:12,
from src/unit_tests_theo.cpp:2:
/usr/include/c++/4.8.2/tuple:687:12: error: previous definition of ‘struct std::tuple_element<0ul, std::tuple<_El0, _El ...> >’
struct tuple_element<0, tuple<_Head, _Tail...> >
^
In file included from /usr/include/c++/4.8.2/tr1/functional:39:0,
from /usr/local/include/google/dense_hash_map:106,
from sagarmatha/utils/include/multicast_receiver.h:11,
from include/transmitter/mcx_receiver.h:25,
from src/unit_tests_theo.cpp:7:
/usr/include/c++/4.8.2/tr1/tuple:248:12: error: redefinition of ‘struct std::tuple_size<std::tuple<_Args1 ...> >’
struct tuple_size<tuple<_Elements...> >
^
In file included from /usr/include/c++/4.8.2/bits/stl_map.h:63:0,
from /usr/include/c++/4.8.2/map:61,
from 8k/include/Source.h:12,
from src/unit_tests_theo.cpp:2:
/usr/include/c++/4.8.2/tuple:737:12: error: previous definition of ‘struct std::tuple_size<std::tuple<_Args1 ...> >’
struct tuple_size<tuple<_Elements...>>
^
In file included from /usr/include/c++/4.8.2/tr1/functional:39:0,
from /usr/local/include/google/dense_hash_map:106,
from sagarmatha/utils/include/multicast_receiver.h:11,
from include/transmitter/mcx_receiver.h:25,
from src/unit_tests_theo.cpp:7:
/usr/include/c++/4.8.2/tr1/tuple:254:49: error: definition of ‘std::tuple_size<std::tuple<_Args1 ...> >::value’ is not in namespace enclosing ‘std::tuple_size<std::tuple<_Args1 ...> >’ [-fpermissive]
const int tuple_size<tuple<_Elements...> >::value;
Is it related to map and dense_hash_map usage together ? Please help?
Since it solved your problem I'm making this an answer: set -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=0 to instruct the compilation not to use tr1 tuple nor its own tuple implementation.
I am trying to replicate tensorflow serving examples from https://tensorflow.github.io/serving/serving_advanced.html
But I get following error. It is possibly Tensorflow library error. Any help will be greatly appreciated.
:
~/serving$ bazel build //tensorflow_serving/example:mnist_inference_2
INFO: Found 1 target...
ERROR: /home/ubuntu/serving/tensorflow_serving/session_bundle/BUILD:125:1: C++ compilation of rule '//tensorflow_serving/session_bundle:session_bundle' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -iquote . ... (remaining 103 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from ./tensorflow_serving/session_bundle/session_bundle.h:30:0,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
./tensorflow_serving/session_bundle/signature.h:40:22: error: 'Signatures' has not been declared
Signatures* signatures);
^
./tensorflow_serving/session_bundle/signature.h:43:28: error: 'Signatures' does not name a type
Status SetSignatures(const Signatures& signatures,
^
./tensorflow_serving/session_bundle/signature.h:43:40: error: ISO C++ forbids declaration of 'signatures' with no type [-fpermissive]
Status SetSignatures(const Signatures& signatures,
^
./tensorflow_serving/session_bundle/signature.h:51:5: error: 'ClassificationSignature' has not been declared
ClassificationSignature* signature);
^
./tensorflow_serving/session_bundle/signature.h:58:5: error: 'ClassificationSignature' has not been declared
ClassificationSignature* signature);
^
./tensorflow_serving/session_bundle/signature.h:64:31: error: 'RegressionSignature' has not been declared
RegressionSignature* signature);
^
./tensorflow_serving/session_bundle/signature.h:73:32: error: 'ClassificationSignature' does not name a type
Status RunClassification(const ClassificationSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:73:57: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive]
Status RunClassification(const ClassificationSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:83:28: error: 'RegressionSignature' does not name a type
Status RunRegression(const RegressionSignature& signature, const Tensor& input,
^
./tensorflow_serving/session_bundle/signature.h:83:49: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive]
Status RunRegression(const RegressionSignature& signature, const Tensor& input,
^
./tensorflow_serving/session_bundle/signature.h:90:28: error: 'GenericSignature' has not been declared
GenericSignature* signature);
^
./tensorflow_serving/session_bundle/signature.h:94:28: error: 'Signature' has not been declared
Signature* default_signature);
^
./tensorflow_serving/session_bundle/signature.h:100:26: error: 'Signature' has not been declared
Signature* default_signature);
^
./tensorflow_serving/session_bundle/signature.h:106:32: error: 'GenericSignature' does not name a type
Status BindGenericInputs(const GenericSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:106:50: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive]
Status BindGenericInputs(const GenericSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:117:31: error: 'GenericSignature' does not name a type
Status BindGenericNames(const GenericSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:117:49: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive]
Status BindGenericNames(const GenericSignature& signature,
^
tensorflow_serving/session_bundle/session_bundle.cc:68:49: error: 'AssetFile' was not declared in this scope
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:68:49: note: suggested alternative:
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:29,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile'
class AssetFile : public ::google::protobuf::Message {
^
tensorflow_serving/session_bundle/session_bundle.cc:68:58: error: template argument 1 is invalid
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:68:58: error: template argument 2 is invalid
tensorflow_serving/session_bundle/session_bundle.cc: In function 'void tensorflow::serving::{anonymous}::AddAssetsTensorsToInputs(tensorflow::StringPiece, const int&, std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >*)':
tensorflow_serving/session_bundle/session_bundle.cc:70:20: error: request for member 'empty' in 'asset_files', which is of non-class type 'const int'
if (!asset_files.empty()) {
^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: error: no matching function for call to 'begin(const int&)'
for (auto& asset : asset_files) {
^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: candidates are:
In file included from /usr/include/c++/4.8/string:51:0,
from /usr/include/c++/4.8/stdexcept:39,
from /usr/include/c++/4.8/array:38,
from /usr/include/c++/4.8/tuple:39,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/range_access.h:87:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
begin(_Tp (&__arr)[_Nm])
^
/usr/include/c++/4.8/bits/range_access.h:87:5: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types '_Tp [_Nm]' and 'const int'
for (auto& asset : asset_files) {
^
In file included from /usr/include/c++/4.8/string:51:0,
from /usr/include/c++/4.8/stdexcept:39,
from /usr/include/c++/4.8/array:38,
from /usr/include/c++/4.8/tuple:39,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
begin(const _Container& __cont) -> decltype(__cont.begin())
^
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = int]':
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here
/usr/include/c++/4.8/bits/range_access.h:58:5: error: request for member 'begin' in '__cont', which is of non-class type 'const int'
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
begin(_Container& __cont) -> decltype(__cont.begin())
^
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = const int]':
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here
/usr/include/c++/4.8/bits/range_access.h:48:5: error: request for member 'begin' in '__cont', which is of non-class type 'const int'
In file included from /usr/include/c++/4.8/utility:74:0,
from /usr/include/c++/4.8/tuple:38,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/initializer_list:89:5: note: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
begin(initializer_list<_Tp> __ils) noexcept
^
/usr/include/c++/4.8/initializer_list:89:5: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
for (auto& asset : asset_files) {
^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: error: no matching function for call to 'end(const int&)'
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: candidates are:
In file included from /usr/include/c++/4.8/string:51:0,
from /usr/include/c++/4.8/stdexcept:39,
from /usr/include/c++/4.8/array:38,
from /usr/include/c++/4.8/tuple:39,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
end(_Tp (&__arr)[_Nm])
^
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types '_Tp [_Nm]' and 'const int'
for (auto& asset : asset_files) {
^
In file included from /usr/include/c++/4.8/string:51:0,
from /usr/include/c++/4.8/stdexcept:39,
from /usr/include/c++/4.8/array:38,
from /usr/include/c++/4.8/tuple:39,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
end(const _Container& __cont) -> decltype(__cont.end())
^
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = int]':
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here
/usr/include/c++/4.8/bits/range_access.h:78:5: error: request for member 'end' in '__cont', which is of non-class type 'const int'
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
end(_Container& __cont) -> decltype(__cont.end())
^
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = const int]':
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here
/usr/include/c++/4.8/bits/range_access.h:68:5: error: request for member 'end' in '__cont', which is of non-class type 'const int'
In file included from /usr/include/c++/4.8/utility:74:0,
from /usr/include/c++/4.8/tuple:38,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
end(initializer_list<_Tp> __ils) noexcept
^
/usr/include/c++/4.8/initializer_list:99:5: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
for (auto& asset : asset_files) {
^
tensorflow_serving/session_bundle/session_bundle.cc:76:69: error: no matching function for call to 'std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >::push_back(<brace-enclosed initializer list>)'
{asset.tensor_binding().tensor_name(), assets_file_tensor});
^
tensorflow_serving/session_bundle/session_bundle.cc:76:69: note: candidates are:
In file included from /usr/include/c++/4.8/vector:64:0,
from external/protobuf/src/google/protobuf/unknown_field_set.h:43,
from external/protobuf/src/google/protobuf/metadata.h:43,
from bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/core/lib/core/error_codes.pb.h:25,
from external/org_tensorflow/tensorflow/core/lib/core/status.h:22,
from ./tensorflow_serving/session_bundle/session_bundle.h:23,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::basic_string<char>, tensorflow::Tensor>; _Alloc = std::allocator<std::pair<std::basic_string<char>, tensorflow::Tensor> >; std::vector<_Tp, _Alloc>::value_type = std::pair<std::basic_string<char>, tensorflow::Tensor>]
push_back(const value_type& __x)
^
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<std::basic_string<char>, tensorflow::Tensor>&}'
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<std::basic_string<char>, tensorflow::Tensor>; _Alloc = std::allocator<std::pair<std::basic_string<char>, tensorflow::Tensor> >; std::vector<_Tp, _Alloc>::value_type = std::pair<std::basic_string<char>, tensorflow::Tensor>]
push_back(value_type&& __x)
^
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >::value_type&& {aka std::pair<std::basic_string<char>, tensorflow::Tensor>&&}'
tensorflow_serving/session_bundle/session_bundle.cc: At global scope:
tensorflow_serving/session_bundle/session_bundle.cc:103:39: error: 'AssetFile' was not declared in this scope
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:103:39: note: suggested alternative:
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:29,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile'
class AssetFile : public ::google::protobuf::Message {
^
tensorflow_serving/session_bundle/session_bundle.cc:103:48: error: template argument 1 is invalid
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:103:48: error: template argument 2 is invalid
tensorflow_serving/session_bundle/session_bundle.cc:117:36: error: 'AssetFile' was not declared in this scope
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:117:36: note: suggested alternative:
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:29,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile'
class AssetFile : public ::google::protobuf::Message {
^
tensorflow_serving/session_bundle/session_bundle.cc:117:45: error: template argument 1 is invalid
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:117:45: error: template argument 2 is invalid
tensorflow_serving/session_bundle/session_bundle.cc: In function 'tensorflow::Status tensorflow::serving::LoadSessionBundleFromPath(const tensorflow::SessionOptions&, tensorflow::StringPiece, tensorflow::serving::SessionBundle*)':
tensorflow_serving/session_bundle/session_bundle.cc:165:15: error: 'AssetFile' was not declared in this scope
std::vector<AssetFile> asset_files;
^
tensorflow_serving/session_bundle/session_bundle.cc:165:15: note: suggested alternative:
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:29,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile'
class AssetFile : public ::google::protobuf::Message {
^
tensorflow_serving/session_bundle/session_bundle.cc:165:24: error: template argument 1 is invalid
std::vector<AssetFile> asset_files;
^
tensorflow_serving/session_bundle/session_bundle.cc:165:24: error: template argument 2 is invalid
tensorflow_serving/session_bundle/session_bundle.cc:165:37: error: invalid type in declaration before ';' token
std::vector<AssetFile> asset_files;
^
tensorflow_serving/session_bundle/session_bundle.cc:170:17: error: expected ';' before 'asset_file'
AssetFile asset_file;
^
tensorflow_serving/session_bundle/session_bundle.cc:171:25: error: the value of 'AssetFile' is not usable in a constant expression
if (!any_asset.Is<AssetFile>()) {
^
tensorflow_serving/session_bundle/session_bundle.cc:165:15: note: 'AssetFile' was not declared 'constexpr'
std::vector<AssetFile> asset_files;
^
tensorflow_serving/session_bundle/session_bundle.cc:171:36: error: no matching function for call to 'google::protobuf::Any::Is() const'
if (!any_asset.Is<AssetFile>()) {
^
tensorflow_serving/session_bundle/session_bundle.cc:171:36: note: candidate is:
In file included from bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/core/protobuf/meta_graph.pb.h:32:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:25,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
external/protobuf/src/google/protobuf/any.pb.h:66:29: note: template<class T> bool google::protobuf::Any::Is() const
template<typename T> bool Is() const {
^
external/protobuf/src/google/protobuf/any.pb.h:66:29: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:174:13: error: 'asset_file' was not declared in this scope
asset_file.descriptor()->full_name(), ". Got: ",
^
tensorflow_serving/session_bundle/session_bundle.cc:178:32: error: 'asset_file' was not declared in this scope
if (!any_asset.UnpackTo(&asset_file)) {
^
tensorflow_serving/session_bundle/session_bundle.cc:182:19: error: request for member 'push_back' in 'asset_files', which is of non-class type 'int'
asset_files.push_back(asset_file);
^
tensorflow_serving/session_bundle/session_bundle.cc:182:29: error: 'asset_file' was not declared in this scope
asset_files.push_back(asset_file);
^
Target //tensorflow_serving/example:mnist_inference_2 failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.822s, Critical Path: 4.54s
From the page you linked: "Before getting started, please complete the prerequisites."
The type Signatures is defined in a header generated by following said prereqs process, so you've either not followed those steps or not followed them correctly – there's no way to tell which just from the compiler errors.
I've been trying to build z3 unstable branch in the past two days but unfortunately I got many errors that do not make sense. I have no idea where is the problem. I have OSX 10.9.
Here is the list of errors
....-MacBook-Pro:build ....$ make
src/api/api_interp.cpp
In file included from ../src/api/api_interp.cpp:35:
In file included from ../src/interp/iz3interp.h:23:
../src/interp/iz3hash.h:72:14: error: no matching function for call to object of
type 'const __gnu_cxx::hash<char *>'
return H(s.c_str());
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ext/__hash:38:12: note:
candidate function not viable: 1st argument ('const_pointer'
(aka 'const char *')) would lose const qualifier
size_t operator()(char *__c) const _NOEXCEPT
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:221:31: error: no type named 'vector' in namespace 'std';
did you mean 'hecto'?
ast make(opr op, const std::vector<ast> &args);
~~~~~^~~~~~
hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note:
'hecto' declared here
typedef ratio< 100LL, 1LL> hecto;
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:221:37: error: expected ')'
ast make(opr op, const std::vector<ast> &args);
^
../src/interp/iz3mgr.h:221:11: note: to match this '('
ast make(opr op, const std::vector<ast> &args);
^
../src/interp/iz3mgr.h:226:33: error: no type named 'vector' in namespace 'std';
did you mean 'hecto'?
ast make(symb sym, const std::vector<ast> &args);
~~~~~^~~~~~
hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note:
'hecto' declared here
typedef ratio< 100LL, 1LL> hecto;
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:226:39: error: expected ')'
ast make(symb sym, const std::vector<ast> &args);
^
../src/interp/iz3mgr.h:226:11: note: to match this '('
ast make(symb sym, const std::vector<ast> &args);
^
../src/interp/iz3mgr.h:231:37: error: no type named 'vector' in namespace 'std';
did you mean 'hecto'?
ast make_quant(opr op, const std::vector<ast> &bvs, ast &body);
~~~~~^~~~~~
hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note:
'hecto' declared here
typedef ratio< 100LL, 1LL> hecto;
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:231:43: error: expected ')'
ast make_quant(opr op, const std::vector<ast> &bvs, ast &body);
^
../src/interp/iz3mgr.h:231:17: note: to match this '('
ast make_quant(opr op, const std::vector<ast> &bvs, ast &body);
^
../src/interp/iz3mgr.h:232:38: error: no type named 'vector' in namespace 'std';
did you mean 'hecto'?
ast clone(const ast &t, const std::vector<ast> &args);
~~~~~^~~~~~
hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note:
'hecto' declared here
typedef ratio< 100LL, 1LL> hecto;
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:232:44: error: expected ')'
ast clone(const ast &t, const std::vector<ast> &args);
^
../src/interp/iz3mgr.h:232:12: note: to match this '('
ast clone(const ast &t, const std::vector<ast> &args);
^
../src/interp/iz3mgr.h:238:8: error: no type named 'vector' in namespace 'std';
did you mean 'hecto'?
std::vector<ast> cook(ptr_vector<raw_ast> v) {
~~~~~^~~~~~
hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note:
'hecto' declared here
typedef ratio< 100LL, 1LL> hecto;
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:238:14: error: expected member name or ';' after
declaration specifiers
std::vector<ast> cook(ptr_vector<raw_ast> v) {
~~~~~~~~~~~^
../src/interp/iz3mgr.h:383:3: error: unknown type name 'lemma_theory'
lemma_theory get_theory_lemma_theory(const ast &proof){
^
../src/interp/iz3mgr.h:417:49: error: no type named 'vector' in namespace 'std';
did you mean 'hecto'?
void get_farkas_coeffs(const ast &proof, std::vector<ast>& coeffs);
~~~~~^~~~~~
hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note:
'hecto' declared here
typedef ratio< 100LL, 1LL> hecto;
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:417:55: error: expected ')'
void get_farkas_coeffs(const ast &proof, std::vector<ast>& coeffs);
^
../src/interp/iz3mgr.h:417:25: note: to match this '('
void get_farkas_coeffs(const ast &proof, std::vector<ast>& coeffs);
^
../src/interp/iz3mgr.h:419:49: error: no type named 'vector' in namespace 'std';
did you mean 'hecto'?
void get_farkas_coeffs(const ast &proof, std::vector<rational>& rats);
~~~~~^~~~~~
hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note:
'hecto' declared here
typedef ratio< 100LL, 1LL> hecto;
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:419:55: error: expected ')'
void get_farkas_coeffs(const ast &proof, std::vector<rational>& rats);
^
../src/interp/iz3mgr.h:419:25: note: to match this '('
void get_farkas_coeffs(const ast &proof, std::vector<rational>& rats);
^
../src/interp/iz3mgr.h:419:8: error: class member cannot be redeclared
void get_farkas_coeffs(const ast &proof, std::vector<rational>& rats);
^
../src/interp/iz3mgr.h:417:8: note: previous declaration is here
void get_farkas_coeffs(const ast &proof, std::vector<ast>& coeffs);
^
../src/interp/iz3mgr.h:421:56: error: no type named 'vector' in namespace 'std';
did you mean 'hecto'?
void get_assign_bounds_coeffs(const ast &proof, std::vector<rational>& rats);
~~~~~^~~~~~
hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note:
'hecto' declared here
typedef ratio< 100LL, 1LL> hecto;
^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:421:62: error: expected ')'
void get_assign_bounds_coeffs(const ast &proof, std::vector<rational>& rats);
^
../src/interp/iz3mgr.h:421:32: note: to match this '('
void get_assign_bounds_coeffs(const ast &proof, std::vector<rational>& rats);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [api/api_interp.o] Error 1
I checked the first 2 errors manually but the code seems fine. PLEASE help
Thanks
Yaco
Thanks for reporting this. I haven't seen any similar reports yet, but I just fixed a couple of problems that appeared when the new OSX and XCode came out. For details, see here.
Could you update to the latest version of the unstable branch and try again (also re-run python scripts/mk_make.py). Thanks!