error:not a class - c++

This is a discussion on error:not a class - c++ ; Hi friends, i am new to c++ programming,when i compile c++ program got the error as " not a class or struct name .I added all the headers files it asked when compiling, but still getting error. suggest me any ...

+ Reply to Thread
Results 1 to 4 of 4

error:not a class

  1. Default error:not a class

    Hi friends,

    i am new to c++ programming,when i compile c++ program got the error
    as " not a class or struct name .I added all the headers files it
    asked when compiling, but still getting error.
    suggest me any idea that where i would have done wrong.

    Error Report::
    "RTPSource.hpp", line 49: cc0262: error: not a class or struct name

    PLease explain me generally why this error occurs..

    Any help in this would be appreciated.

    thanks&regards


  2. Default Re: error:not a class

    * yeah:
    > Hi friends,
    >
    > i am new to c++ programming,when i compile c++ program got the error
    > as " not a class or struct name .I added all the headers files it
    > asked when compiling, but still getting error.
    > suggest me any idea that where i would have done wrong.
    >
    > Error Report::
    > "RTPSource.hpp", line 49: cc0262: error: not a class or struct name
    >
    > PLease explain me generally why this error occurs..
    >
    > Any help in this would be appreciated.
    >
    > thanks&regards
    >


    Actually showing us the code would be better.

    --
    Derek

  3. Default Re: error:not a class

    On Nov 7, 10:03 am, DerekBaker <De...@DontBother.com> wrote:
    > * yeah:
    >
    >
    >
    > > Hi friends,

    >
    > > i am new to c++ programming,when i compile c++ program got the error
    > > as " not a class or struct name .I added all the headers files it
    > > asked when compiling, but still getting error.
    > > suggest me any idea that where i would have done wrong.

    >
    > > Error Report::
    > > "RTPSource.hpp", line 49: cc0262: error: not a class or struct name

    >
    > > PLease explain me generally why this error occurs..

    >
    > > Any help in this would be appreciated.

    >
    > > thanks&regards

    >
    > Actually showing us the code would be better.
    >
    > --
    > Derek



    This is the code of RTPSource.hpp

    #ifndef _RTP_SOURCE_HPP

    #define _RTP_SOURCE_HPP

    /*#ifndef _FRAMED_SOURCE_HPP

    #include "FramedSource.hpp"

    #endif

    #ifndef _RTP_INTERFACE_HPP

    #include "RTPInterface.hpp"

    #endif

    #include "NetCommon.hpp"

    #include "MultiFramedRTPSource.hpp"

    #include "sockets.hpp"

    #ifndef _RTP_SOURCE_HPP

    #define _RTP_SOURCE_HPP*/

    #ifndef _FRAMED_SOURCE_HPP

    #include "FramedSource.hpp"

    #endif

    #ifndef _RTP_INTERFACE_HPP

    #include "RTPInterface.hpp"

    #endif

    //typedef __int64 int64_t;

    //typedef unsigned __int64 u_int64_t;

    typedef unsigned u_int32_t;

    typedef unsigned short u_int16_t;

    typedef unsigned char u_int8_t;

    class RTPReceptionStatsDB; // forward

    class RTPSource: public FramedSource { //this is the place where I
    am getting error

    public:

    static Boolean lookupByName(UsageEnvironment& env, char const*
    sourceName,

    RTPSource*& resultSource);

    u_int16_t curPacketRTPSeqNum() const { return fCurPacketRTPSeqNum; }

    u_int32_t curPacketRTPTimestamp() const { return
    fCurPacketRTPTimestamp; }

    Boolean curPacketMarkerBit() const { return fCurPacketMarkerBit; }

    unsigned char rtpPayloadFormat() const { return
    fRTPPayloadFormat; }

    virtual Boolean hasBeenSynchronizedUsingRTCP();

    Groupsock* RTPgs() const { return fRTPInterface.gs(); }

    virtual void setPacketReorderingThresholdTime(unsigned uSeconds) =
    0;

    // used by RTCP:

    u_int32_t SSRC() const { return fSSRC; }

    // Note: This is *our* SSRC, not the SSRC in incoming RTP
    packets.

    // later need a means of changing the SSRC if there's a collision
    #####

    unsigned timestampFrequency() const {return fTimestampFrequency;}

    RTPReceptionStatsDB& receptionStatsDB() const {

    return *fReceptionStatsDB;

    }

    u_int32_t lastReceivedSSRC() const { return fLastReceivedSSRC; }

    // Note: This is the SSRC in the most recently received RTP packet;
    not *our* SSRC

    void setStreamSocket(int sockNum, unsigned char streamChannelId) {

    // hack to allow sending RTP over TCP (RFC 2236, section 10.12)

    fRTPInterface.setStreamSocket(sockNum, streamChannelId);

    }

    void setAuxilliaryReadHandler(AuxHandlerFunc* handlerFunc,

    void* handlerClientData) {

    fRTPInterface.setAuxilliaryReadHandler(handlerFunc,

    handlerClientData);

    }

    protected:

    RTPSource(UsageEnvironment& env, Groupsock* RTPgs,

    unsigned char rtpPayloadFormat, u_int32_t
    rtpTimestampFrequency);

    // abstract base class

    virtual ~RTPSource();

    protected:

    RTPInterface fRTPInterface;

    u_int16_t fCurPacketRTPSeqNum;

    u_int32_t fCurPacketRTPTimestamp;

    Boolean fCurPacketMarkerBit;

    Boolean fCurPacketHasBeenSynchronizedUsingRTCP;

    u_int32_t fLastReceivedSSRC;

    private:

    // redefined virtual functions:

    virtual Boolean isRTPSource() const;

    virtual void getAttributes() const;

    private:

    unsigned char fRTPPayloadFormat;

    unsigned fTimestampFrequency;

    u_int32_t fSSRC;

    RTPReceptionStatsDB* fReceptionStatsDB;

    };


  4. Default Re: error:not a class

    yeah wrote:

    > /*#ifndef _FRAMED_SOURCE_HPP
    >
    > #include "FramedSource.hpp"
    >

    Ugh... Don't use /* to disable code. Use the #if. Comments don't
    nest so if you inadvertantly add another /* */ style comment some where
    you'll get a surprise.

    > class RTPSource: public FramedSource


    I suspect that FramedSource is not defined at this point based on the
    compiler error. While it appears that the FramedSource.hpp (the second
    time it appears) should be included, the include guards are highly suspect.

    I sometimes resort to a dodge to determine if code is actually getting
    compiled or not in light of lots of #if and #include usage.

    I stick crud like:

    2.2.2.2

    which is syntacitally invalid in places I wish to see if they are
    reached. If I get an error about it, I know I got there.

+ Reply to Thread

Similar Threads

  1. error:not a class
    By Application Development in forum C
    Replies: 2
    Last Post: 11-06-2007, 08:20 AM
  2. CLASS error
    By Application Development in forum xharbour
    Replies: 6
    Last Post: 10-07-2007, 03:07 AM
  3. Class Not registered error
    By Application Development in forum ADO DAO RDO RDS
    Replies: 3
    Last Post: 09-12-2007, 07:58 AM
  4. my first class - getting an error
    By Application Development in forum CSharp
    Replies: 4
    Last Post: 09-10-2007, 11:23 PM
  5. error in class
    By Application Development in forum basic.visual
    Replies: 2
    Last Post: 12-22-2003, 10:07 PM