我写了个qt程序,在使用电脑上的g++链接make时没有错误,但我需要把程序载到板子上运行,我就把makefile里的链接改为arm-linux-g++,路径没问题,但是这次make时就出现了:“make****[forever.o] 浮点数例外”的问题,始终编译通不过,而且我cpp文件和头文件里都没有浮点型的数啊,都是整型的,程序如下:
#ifndef FOREVER_H
#define FOREVER_H
#include <qwidget.h>
const int numColors = 120;
class Forever : public QWidget
{
    Q_OBJECT
public:
    Forever( QWidget *parent=0, const char *name=0 );
protected:
    void        paintEvent( QPaintEvent * );
    void        timerEvent( QTimerEvent * );
private slots:
    void        updateCaption();
private:
    int        i;
    int        rectangles;
    QColor      colors[numColors];
};
#endif                                                                  //头文件
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <qtimer.h>
#include <qpainter.h>
#include <qapplication.h>
#include <stdlib.h>                            // defines rand() function
#include <qpixmap.h>
#include "forever.h"
//
// Forever - a widget that draws rectangles forever.
//
//
// Constructs a Forever widget.
//
Forever::Forever( QWidget *parent, const char *name )
    : QWidget( parent, name )
{
  
    rectangles = 0;
    startTimer(1000);          // run continuous timer  ,时间间隔
    QTimer * counter = new QTimer( this );
    connect( counter, SIGNAL(timeout()),
            this, SLOT(updateCaption()) );
    counter->start( 1000 );
}
void Forever::updateCaption()
{
    QString s;
    s.sprintf( "Qt Example - Forever - %d rectangles/second", rectangles );  //同上
    rectangles = 0;
    setCaption( s );
}
//
// Handles paint events for the Forever widget.
//
void Forever::paintEvent( QPaintEvent * )    //开始画图
{
  
    QString str = QString("%1.bmp").arg(i);
    QPixmap image(str);
    QPainter paint;
    paint.begin(this);
    paint.drawPixmap(51,53,image);
    paint.end();
  
  
}
//
// Handles timer events for the Forever widget.
//
void Forever::timerEvent( QTimerEvent * )
{
    for ( i=1; i<4; i++ ) {
        repaint( TRUE );        // repaint ,擦拭后重画,这里就使依次显示了,但不知怎么
                                    // 会不停的重复依次显示,
        rectangles++;
    }
}
//
// Create and display Forever widget.
//
int main( int argc, char **argv )
{
    QApplication a( argc, argv );              // create application object
    QTimer::singleShot( 10*1000, &a, SLOT(quit()) );    //10秒后关闭
    Forever always;                            // create widget
    a.setMainWidget( &always );                // set as main widget
    always.setCaption("Qt Example - Forever");
    always.show();                              // show widget
    a.exec();                            // run event loop
}