Re: Error in parser

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

 



On 10/21/2017 03:24 PM, Vivek wrote:
I am using GCC version on RHEL 7.3 OS and the following are the details:

$ cat /etc/redhat-release*
Red Hat Enterprise Linux Server release 7.3 (Maipo)
$ uname -r
3.10.0-514.16.1.el7.x86_64

and my gcc version is :
[ptguser@zuse1dovidmg10 ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto
--enable-plugin --enable-initfini-array --disable-libgcj
--with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)

I am getting the following error when compiling C++ code:

src/db/parser.y:1619:26: error: ‘location_type’ does not name a type
 void parser::error(const location_type& a_loc,const std::string& a_msg)
                          ^
src/db/parser.y:1619:41: error: ISO C++ forbids declaration of ‘a_loc’ with
no type [-fpermissive]
 void parser::error(const location_type& a_loc,const std::string& a_msg)
                                         ^
src/db/parser.y:1619:6: error: prototype for ‘void
layer_yy::parser::error(const int&, const string&)’ does not match any in
class ‘layer_yy::parser’
 void parser::error(const location_type& a_loc,const std::string& a_msg)
      ^
parsery.cpp:2079:3: error: candidates are: void
layer_yy::parser::error(const Layer_yy::parser::syntax_error&)
   parser::error (const syntax_error& yyexc)

Can you please help?

The error means that location_type has not been declared as a type
before the following declaration:

void parser::error(const location_type& a_loc,const std::string& a_msg)

It most likely means that the parser.y file is missing a #include
directive with a header that defines the type.  Probably because
of a mistake in the input file from which parser.y was generated.

It's not really a problem specific to GCC.  I suggest searching
the Web for the error message.

Martin



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux