error:not a class

Y

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
 
D

DerekBaker

* 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.
 
Y

yeah

* yeah:









Actually showing us the code would be better.


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;

};
 
R

Ron Natalie

yeah said:
/*#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.
 

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
474,197
Messages
2,571,040
Members
47,634
Latest member
RonnyBoelk

Latest Threads

Top