C++/Bison Question

T

Tom McCallum

Hi everyone,

I am trying to compile a bison tab.cc file in with a c++ program I am
writing. The program compiles fine without the parser attached but when I
compile with it, it comes up with lots of errors to do with typeinfo and
math.h for some reason. I have included the errors below - any help would
be most appreciated.

Thanks in advance

Tom

******** Top of Bison file **************
#include <string>
#include <list>
#include <map>
#include "objects.h"

using namespace std;
***************************************

******* Error output ********************

In file included from /usr/include/c++/3.2.2/ios:48,
from /usr/include/c++/3.2.2/ostream:45,
from /usr/include/c++/3.2.2/iostream:45,
from clengthspec.h:22,
from objects.h:12,
from problem.yy:5:
/usr/include/c++/3.2.2/bits/localefwd.h:239: declaration does not declare
anything
/usr/include/c++/3.2.2/bits/localefwd.h:239: parse error before numeric
constant
In file included from /usr/include/c++/3.2.2/cmath:51,
from /usr/include/c++/3.2.2/bits/locale_facets.tcc:41,
from /usr/include/c++/3.2.2/locale:46,
from /usr/include/c++/3.2.2/bits/ostream.tcc:37,
from /usr/include/c++/3.2.2/ostream:275,
from /usr/include/c++/3.2.2/iostream:45,
from clengthspec.h:22,
from objects.h:12,
from problem.yy:5:
/usr/include/math.h:281: parse error before numeric constant
In file included from /usr/include/c++/3.2.2/bits/locale_facets.tcc:45,
from /usr/include/c++/3.2.2/locale:46,
from /usr/include/c++/3.2.2/bits/ostream.tcc:37,
from /usr/include/c++/3.2.2/ostream:275,
from /usr/include/c++/3.2.2/iostream:45,
from clengthspec.h:22,
from objects.h:12,
from problem.yy:5:
/usr/include/c++/3.2.2/typeinfo:84: parse error before numeric constant
/usr/include/c++/3.2.2/typeinfo:98: semicolon missing after declaration of
`
std::type_info'
/usr/include/c++/3.2.2/typeinfo:99: ISO C++ forbids defining types within
return type
/usr/include/c++/3.2.2/typeinfo:99: `bool' is now a keyword
/usr/include/c++/3.2.2/typeinfo:99: non-member function `std::type_info
std::before(const std::type_info&)' cannot have `const' method qualifier
/usr/include/c++/3.2.2/typeinfo:99: semicolon missing after declaration of
`
class std::type_info'
/usr/include/c++/3.2.2/typeinfo: In function `int std::before(const
std::type_info&)':
/usr/include/c++/3.2.2/typeinfo:99: `__name' undeclared (first use this
function)
/usr/include/c++/3.2.2/typeinfo:99: (Each undeclared identifier is
reported
only once for each function it appears in.)
/usr/include/c++/3.2.2/typeinfo:75: `const char*std::type_info::__name' is
protected
/usr/include/c++/3.2.2/typeinfo:99: within this context
/usr/include/c++/3.2.2/typeinfo: At global scope:
/usr/include/c++/3.2.2/typeinfo:101: non-member function `bool
std::eek:perator==(const std::type_info&)' cannot have `const' method
qualifier
/usr/include/c++/3.2.2/typeinfo:101: `bool std::eek:perator==(const
std::type_info&)' must take exactly two arguments
/usr/include/c++/3.2.2/typeinfo: In function `bool std::eek:perator==(const
std::type_info&)':
/usr/include/c++/3.2.2/typeinfo:75: `const char*std::type_info::__name' is
protected
/usr/include/c++/3.2.2/typeinfo:101: within this context
/usr/include/c++/3.2.2/typeinfo: At global scope:
/usr/include/c++/3.2.2/typeinfo:104: non-member function `bool
std::eek:perator!=(const std::type_info&)' cannot have `const' method
qualifier
/usr/include/c++/3.2.2/typeinfo:104: `bool std::eek:perator!=(const
std::type_info&)' must take exactly two arguments
/usr/include/c++/3.2.2/typeinfo:107: parse error before `public'
/usr/include/c++/3.2.2/typeinfo:111: virtual outside class declaration
/usr/include/c++/3.2.2/typeinfo:111: non-member function `bool
std::__is_function_p()' cannot have `const' method qualifier
/usr/include/c++/3.2.2/typeinfo:120: virtual outside class declaration
/usr/include/c++/3.2.2/typeinfo:120: non-member function `bool
std::__do_catch(const std::type_info*, void**, unsigned int)' cannot
have `
const' method qualifier
/usr/include/c++/3.2.2/typeinfo:124: virtual outside class declaration
/usr/include/c++/3.2.2/typeinfo:124: non-member function `bool
std::__do_upcast(const __cxxabiv1::__class_type_info*, void**)' cannot
have
`const' method qualifier
/usr/include/c++/3.2.2/typeinfo:149: parse error before `}' token
In file included from objects.h:15,
from problem.yy:5:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top