compilation error

Discussion in 'C++' started by yeah, Nov 13, 2007.

  1. yeah

    yeah Guest

    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
     
    yeah, Nov 13, 2007
    #1
    1. Advertising

  2. 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
     
    Michael DOUBEZ, Nov 13, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vittal
    Replies:
    2
    Views:
    723
    Gordon Burditt
    Jul 8, 2003
  2. =?ISO-8859-1?Q?Martin_J=F8rgensen?=
    Replies:
    5
    Views:
    1,315
    =?ISO-8859-1?Q?Martin_J=F8rgensen?=
    May 6, 2006
  3. Gavin
    Replies:
    3
    Views:
    493
    Chris Uppal
    Mar 28, 2007
  4. C__chp
    Replies:
    4
    Views:
    520
    Puppet_Sock
    Feb 15, 2008
  5. Tassador

    const string error compilation - error C2679

    Tassador, Jul 19, 2009, in forum: C Programming
    Replies:
    0
    Views:
    629
    Tassador
    Jul 19, 2009
Loading...

Share This Page