bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiler error .hh file


From: Gilberto Monroy
Subject: Re: compiler error .hh file
Date: Thu, 19 Dec 2013 12:15:18 -0600

Akim:
1 Yeah, you are right, I removed the .h and .hh files from the compilation
line, but the result is the same.
2 Actually, the .hh file is included in rcss_driver.h, wich is included in
rcss_parser.y. John is right, there are inclusion guardas in the .hh file,
that is not the problem. I changed the code a bit in a way I do not
(directly or indirectly) include  the .hh file in the .y file, but the
result is similar:

g++ -o parser  rcss_parser.tab.cc lex.yy.c rcss_parser_driver.cpp -lfl
In file included from rcss_parser.tab.cc:53:0:
rcss_parser.tab.hh:583:3: error:
‘yy::RcssParser::basic_symbol<Base>::basic_symbol(typename Base::kind_type,
Playmode, const location_type&)’ cannot be overloaded
rcss_parser.tab.hh:579:3: error: with
‘yy::RcssParser::basic_symbol<Base>::basic_symbol(typename Base::kind_type,
Playmode, const location_type&)’
rcss_parser.tab.hh:1896:3: error: redefinition of
‘yy::RcssParser::basic_symbol<Base>::basic_symbol(typename Base::kind_type,
Playmode, const location_type&)’
rcss_parser.tab.hh:1882:3: error:
‘yy::RcssParser::basic_symbol<Base>::basic_symbol(typename Base::kind_type,
Playmode, const location_type&)’ previously declared here
In file included from rcss_lexer.l:28:0:
rcss_parser.tab.hh:583:3: error:
‘yy::RcssParser::basic_symbol<Base>::basic_symbol(typename Base::kind_type,
Playmode, const location_type&)’ cannot be overloaded
rcss_parser.tab.hh:579:3: error: with
‘yy::RcssParser::basic_symbol<Base>::basic_symbol(typename Base::kind_type,
Playmode, const location_type&)’
rcss_parser.tab.hh:1896:3: error: redefinition of
‘yy::RcssParser::basic_symbol<Base>::basic_symbol(typename Base::kind_type,
Playmode, const location_type&)’
rcss_parser.tab.hh:1882:3: error:
‘yy::RcssParser::basic_symbol<Base>::basic_symbol(typename Base::kind_type,
Playmode, const location_type&)’ previously declared here
make: *** [parser] Error 1





On Thu, Dec 19, 2013 at 10:07 AM, John Horigan <address@hidden> wrote:

> But the generated header has inclusion guards. He should be able to
> include it multiple times, even if it is a bad idea. There must be another
> problem.
>
> -- john
>
>
> On Thu, Dec 19, 2013 at 3:09 AM, Akim Demaille <address@hidden> wrote:
>
>>
>> Le 19 déc. 2013 à 03:15, Gilberto Monroy <address@hidden> a
>> écrit :
>>
>> > Hi everybody.
>> >
>> > My name is Gilberto, I use the next tools:
>>
>> Hi Gilberto,
>>
>> > g++ -o parser location.hh position.hh rcss_parser.tab.cc lex.yy.c
>> rcss_parser_driver.cpp -lfl
>>
>> This compilation line is fishy.  You are not expected to compile
>> the headers (*.hh files).  Compile only *.cc and *.ccp files.
>>
>> >                 from rcss_parser.y:15:
>> > rcss_parser.tab.hh:583:3: error:
>>
>> If I read this correctly, in your *.y file you #include the generated
>> parser header.  Don't do that, Bison does for you.  This would explain
>> why the symbols are defined twice.
>>
>>
>>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]