主题 : compile error 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 26166
精华: 0
发帖: 18
金钱: 95 两
威望: 19 点
综合积分: 36 分
注册时间: 2010-08-04
最后登录: 2013-05-28
楼主  发表于: 2010-08-12 13:40

 compile error

Hi, there. I got an error when I compile my program on mini2440. Here is the problem, I override a new frame class, but it incurs a compile error.
---------------------frame.h---------------
#ifndef FRAME_H
#define FRAME_H

#include <qframe.h>
#include <qpainter.h>

class Frame : public QFrame
{
Q_OBJECT
public:
  Frame(QWidget* parent=0,const char* name=0,WFlags f=0);
protected:
  //void paintEvent(QPaintEvent*);
private:
};
#endif

-------------frame.cpp---------------------
#include "frame.h"
Frame::Frame(QWidget* parent,const char* name,WFlags f)
    : QFrame(parent,name,f)
{
  setFrameStyle(QFrame::Panel);
}
/*
void Frame::paintEvent(QPainter *p)
{
  QFrame::paintEvent(p);
}
*/

I add this class into hello project, then it shows:
undefined reference to `Frame::Frame[in-charge](QWidget*, char const*, unsigned)'
collect2: ld returned 1 exit status
make: *** [/opt/FriendlyARM/mini2440/x86-qtopia/qtopia/bin/hello] Error 1

so, it means I had not add this class into the project successful? can somebody help me fixing this problem, any suggestions will be appreciated.