CHAR_BIT issue in gcc 3.3.1

R

Ryan Liu

All,

When I include <vector> head file in our application. It generates the
following following error when complileing.


In file included from
/opt/exp/gnu/sparc-sun-solaris2.8/include/c++/3.3.1/vector:72,
from stl_inc.h:8,
from Environment.h:5,
from Environment.cpp:1:
/opt/exp/gnu/sparc-sun-solaris2.8/include/c++/3.3.1/bits/stl_bvector.h:67:
error: `
CHAR_BIT' was not declared in this scope
/opt/exp/gnu/sparc-sun-solaris2.8/include/c++/3.3.1/bits/stl_bvector.h:67:
error: enumerator
value for `_M_word_bit' not integer constant

I don't know why it generate this error. Becuase you know stl_bvector.h is
system file, I can't change it.
Would you mind giving some suggestion?:

Thank you very much in advance.

Ryan
 
J

John Harrison

Ryan Liu said:
All,

When I include <vector> head file in our application. It generates the
following following error when complileing.


In file included from
/opt/exp/gnu/sparc-sun-solaris2.8/include/c++/3.3.1/vector:72,
from stl_inc.h:8,
from Environment.h:5,
from Environment.cpp:1:
/opt/exp/gnu/sparc-sun-solaris2.8/include/c++/3.3.1/bits/stl_bvector.h:67:
error: `
CHAR_BIT' was not declared in this scope
/opt/exp/gnu/sparc-sun-solaris2.8/include/c++/3.3.1/bits/stl_bvector.h:67:
error: enumerator
value for `_M_word_bit' not integer constant

I don't know why it generate this error. Becuase you know stl_bvector.h is
system file, I can't change it.
Would you mind giving some suggestion?:

Thank you very much in advance.

Ryan

CHAR_BIT is defined in a header called <limits.h> so you could try including
that in your code before you include <vector>.

But almost certainly this error means there is something wrong with the way
gcc is installed on your system, so I'd spend some time trying to find out
what the real cause of the problem is. Perhaps you should ask on a gcc group
for help with this, since it isn't a C++ language issue.

john
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top