Re: [Beginner question]How to solve multiple definition of `yylval'?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [Beginner question]How to solve multiple definition of `yylval'?
Дата
Msg-id 1054458.1683812402@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [Beginner question]How to solve multiple definition of `yylval'?  (Wen Yi <chuxuec@outlook.com>)
Список pgsql-general
Wen Yi <chuxuec@outlook.com> writes:
> When I use the yacc & lex to compile,

> yacc -d 1-3.y
> lex 1-3.l
> gcc 1-3.tab.c lex.yy.c
> /usr/bin/ld: /tmp/ccYqqE5N.o:(.bss+0x28): multiple definition of `yylval'; /tmp/ccdJ12gy.o:(.bss+0x4): first defined
here

Bison provides the declaration of yylval; don't add one yourself.

BTW, this isn't right:

#define YYSTPYE string

first because you misspelled YYSTYPE, and second because you
evidently want yylval to be double not a string.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Wen Yi
Дата:
Сообщение: [Beginner question]How to solve multiple definition of `yylval'?
Следующее
От: Marc Millas
Дата:
Сообщение: Re: Death postgres