PDA

View Full Version : undefined reference to vtable



renjithmamman
29th June 2006, 12:40
/*
* Created On : 2006/02/10
* Revision : 1.0.0
* Purpose : Represents Payscale
* Note : Files without revision and date of creation are to be ignored
*/

#ifndef RANGE_H
#define RANGE_H

#include "List.h"


class RangeDetailItem : public ListItem {
public:
RangeDetailItem() ;

RangeDetailItem( Indicator );
~RangeDetailItem() {}

int minRange() const;
void setMinRange( int iMinRange );

int maxRange() const;
void setMaxRange( int iMaxRange );
/*
int annualIncrement() const;
void setAnnualIncrement( int iAnnualIncrement );
*/
bool load( Q_LLONG lFkeyId );
bool insert();
bool update();
bool remove();

private:
//int m_iAnnualIncrement;
int m_iMaxRange;
int m_iMinRange;
};


class RangeDetail : public List<RangeDetailItem> {
public:
RangeDetail():List<RangeDetailItem>(
"fki_range_id",
"pki_range_detail_id",
"tbl_hrms_range_detail"){}
~RangeDetail() {};
};


class Range : public DataComponent {
public:
Range();

QString code() const;
void setCode( const QString& strCode );

QString remark() const;
void setRemark( const QString& strRemark );


RangeDetail detail() const ;
void setDetail( const RangeDetail& rangeDetail );

bool load( Q_LLONG lPkeyId );

bool insert();
bool update();
bool remove();

private:
bool validateInsert();
bool validateUpdate();

private:
QString m_strCode;
QString m_strRemark;
RangeDetail m_rdDetail;
};



//__RangeDetailItem_________________________________ ________________________

inline RangeDetailItem::RangeDetailItem()
:ListItem( ListItem::Insert,
"fki_range_id",
"pki_range_detail_id",
"tbl_hrms_range_detail") {}

inline RangeDetailItem::RangeDetailItem( Indicator ind )
:ListItem( ind, "fki_range_id",
"pki_range_detail_id", "tbl_hrms_range_detail" ) {}

inline int RangeDetailItem::minRange() const {
return m_iMinRange;
}
inline void RangeDetailItem::setMinRange( int iMinRange ) {
m_iMinRange = iMinRange;
}


inline int RangeDetailItem::maxRange() const {
return m_iMaxRange;
}
inline void RangeDetailItem::setMaxRange( int iMaxRange ) {
m_iMaxRange = iMaxRange;
}

/*
inline int RangeDetailItem::annualIncrement() const {
return m_iAnnualIncrement;
}
inline void PayscaleDetailItem::setAnnualIncrement( int iAnnualIncrement ) {
m_iAnnualIncrement = iAnnualIncrement;
}

*/
//__Payscale________________________________________ _________________

inline Range::Range():DataComponent(
"uvc_range_code","pki_range_id", "tbl_hrms_range") {}

inline QString Range::code() const {
return m_strCode;
}
inline void Range::setCode( const QString& strCode ) {
m_strCode = strCode.stripWhiteSpace();
}

inline QString Range::remark() const {
return m_strRemark;
}
inline void Range::setRemark( const QString& strRemark ) {
m_strRemark = strRemark.stripWhiteSpace();
}

inline RangeDetail Range::detail() const {
return m_rdDetail;
}

inline void Range::setDetail( const RangeDetail& rangeDetail ) {
m_rdDetail = rangeDetail;
}




#endif // RANGE_H


in Line No 86

jacek
29th June 2006, 13:27
Could you post the exact error message?

Chicken Blood Machine
29th June 2006, 17:02
Define at least one function for RangeDetailItem (the destructor will do) in the cpp file. This often happens when you try to fully inline a class that has virtual inheritance - at least one method of the class must be outlined, so the compiler can figure out where to generate the vtable information.

If this doesn't work - well I guess the problem could be somewhere else...

jrideout
30th June 2006, 23:15
This usually happens when you've run qmake without having the Q_OBJECT macro. If you don't have that qmake won't add the right stuff to the make. So, once you've added it make needs to run again or when you link to the moc object it won't exist and will give you a vtable error. Run make clean, then qmake, the make again and see if that works

Chicken Blood Machine
1st July 2006, 20:33
This usually happens when you've run qmake without having the Q_OBJECT macro. If you don't have that qmake won't add the right stuff to the make. So, once you've added it make needs to run again or when you link to the moc object it won't exist and will give you a vtable error. Run make clean, then qmake, the make again and see if that works

I don't think that any of the classes that he has declared there need the Q_OBJECT macro, do they?

jrideout
2nd July 2006, 04:23
Actually, your right, I didn't look at the code closely. Perhaps, my post might give him some ideas though, whatever the reason, a vtable error is a linker matchup problem.