compilation error

Y

yeah

hi
I got the following errors while compiling my c++ file

bitstrm.cpp: In member function 'Void CInBitStream::bookmark(Bool)':
bitstrm.cpp:129: error: 'streampos' does not name a type
bitstrm.cpp:135: error: 'strmpos' was not declared in this scope
bitstrm.cpp:142: error: 'strmpos' was not declared in this scope

source:::
126://Void CInBitStream::bookmark (Bool bSet)
127:Void CInBitStream::bookmark (int bSet)
{
//static Bool bBookmarkOn = FALSE;
static int bBookmarkOn = FALSE;
static streampos strmpos;
static UInt uNumOfBitsInBuffer;
static Char chDecBuffer;
static Int lCounter;

if(bSet) {
strmpos = m_pInStream -> tellg();
uNumOfBitsInBuffer = m_uNumOfBitsInBuffer;
chDecBuffer = m_chDecBuffer;
lCounter = m_lCounter;
bBookmarkOn = TRUE;
}
else {
m_pInStream -> seekg (strmpos);
m_uNumOfBitsInBuffer = uNumOfBitsInBuffer;
m_chDecBuffer = chDecBuffer;
m_lCounter = lCounter;
bBookmarkOn = FALSE;
}
150:}

Is this need any header files to add
 
M

Michael DOUBEZ

yeah a écrit :
hi
I got the following errors while compiling my c++ file

bitstrm.cpp: In member function 'Void CInBitStream::bookmark(Bool)':
bitstrm.cpp:129: error: 'streampos' does not name a type
bitstrm.cpp:135: error: 'strmpos' was not declared in this scope
bitstrm.cpp:142: error: 'strmpos' was not declared in this scope

source:::
126://Void CInBitStream::bookmark (Bool bSet)
127:Void CInBitStream::bookmark (int bSet)
{
//static Bool bBookmarkOn = FALSE;
static int bBookmarkOn = FALSE;
static streampos strmpos; [snip]
Is this need any header files to add

How can we know ? You only provided a small part of the code.

If you have included <iostream> and declared'using namespace std;' or
'using std::streampos;' it should be fine otherwise don't forget the
namspace:
static std::streampos strmpos;


Michael
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top