Duy Huynh
Duy Huynh

Reputation: 31

Reference to ‘tuple’ is ambiguous in SESHAT

I have tried to build SESHAT(Handwritten math expression parser). And I have got an error like this below:

In file included from rnnlib4seshat/DataSequence.hpp:26:0,
             from symrec.h:30,
             from production.h:28,
             from hypothesis.h:30,
             from cellcyk.h:24,
             from tablecyk.h:26,
             from sample.h:27,
             from symfeatures.h:32,
             from symfeatures.cc:18:
rnnlib4seshat/Helpers.hpp:131:15: error: reference to ‘tuple’ is ambiguous
typedef const tuple<real_t&, real_t&, real_t&, real_t&>& TDDDD;
           ^~~~~

I don't have much experience in C programming. Please help me to fix this problem.

Update: This is a part of Helpers.hpp file

#ifndef _INCLUDED_Helpers_h  
#define _INCLUDED_Helpers_h  

#include <boost/date_time.hpp>
#include <boost/date_time/local_time/local_time.hpp>
#include <boost/assign/std/vector.hpp>
#include <boost/iterator/zip_iterator.hpp>
#include <boost/foreach.hpp>
#include <boost/math/distributions.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/range/irange.hpp>
#include <math.h>
#include <numeric>
#include <utility>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <sstream>
#include <list>
#include <set>
#include <algorithm>
#include <iterator>
#include <map>
#include <assert.h>
#include "Log.hpp"

using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace boost::posix_time;
using namespace boost::gregorian;

#define LOOP BOOST_FOREACH
#define LOOP_BACK BOOST_REVERSE_FOREACH
#define DO(x, y) BOOST_FOREACH(BOOST_TYPEOF(*((y).begin()))& (x), (y))
#define DOC(x, y) BOOST_FOREACH(const BOOST_TYPEOF(*((y).begin()))& (x), (y))
#define OD(x, y) BOOST_REVERSE_FOREACH(BOOST_TYPEOF(*((y).begin()))& (x), (y))
#define COD(x, y) BOOST_REVERSE_FOREACH(const BOOST_TYPEOF(*((y).begin()))& (x), (y))
#define REPEAT(n) for(int REPEAT_VARn = 0; REPEAT_VARn < (n); ++REPEAT_VARn)
#define FROM(i, m, n) for(int (i) = (m); (i) < (n); ++(i))
#define MORF(i, m, n) for(int (i) = (n)-1; (i) >= (m); --(i))
#define FOR(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define ROF(i, n) for(int (i) = (n)-1; (i) >= 0; --(i))

//#define FLOAT_REALS

#ifdef FLOAT_REALS
typedef float real_t;
#else 
typedef double real_t;
#endif

....
line 131 begin here
typedef const tuple<real_t&, real_t&, real_t&, real_t&>& TDDDD;
typedef const tuple<real_t&, real_t&, real_t&, real_t&, real_t&>& TDDDDD;
typedef const tuple<real_t&, real_t&, real_t&>& TDDD;
typedef const tuple<real_t&, real_t&, int&>& TDDI;
typedef const tuple<real_t&, real_t&, real_t&>& TDDF;
typedef const tuple<real_t&, real_t&, real_t>& TDDCF;
typedef const tuple<real_t&, real_t&>& TDD;
typedef const tuple<int, string>& TIS;
typedef const tuple<int, int>& TII;
typedef const tuple<int, real_t>& TID;
typedef const tuple<int, set<int>&>& TISETI;
typedef const tuple<int&, bool, int>& TIBI;
typedef const tuple<real_t, Log<real_t>& >& TDL;
typedef const tuple<real_t&, Log<real_t>, Log<real_t> >& TDLL;
typedef Log<real_t> prob_t;

//global variables
....

I have found a similar problem was submitted to the "Issues" tab of this project (https://github.com/falvaro/seshat/issues/16). But there are no answer for this. It seems that the author is not maintain this project anymore. So I actually need your help. Thank you very much and sorry for my bad english.

Upvotes: 1

Views: 897

Answers (1)

Here is a duplicate of the original Github repository including the modifications to allow compilation of modern copiler.

https://github.com/LBrunswic/Seshat

Upvotes: 1

Related Questions