error: expected ',' or '...' before numeric constant

Posted by goldfrapp04 on Stack Overflow See other posts from Stack Overflow or by goldfrapp04
Published on 2012-03-24T05:22:56Z Indexed on 2012/03/24 5:30 UTC
Read the original article Hit count: 210

Filed under:
|
|
|
|

Just a Qt Gui Application with QDialog as the Base Class, the simplest type you can expect. I've programmed on Qt for several times but this is the first time I meet this problem... I've added minimal code to the program, and here's the code in dialog.h (which is mostly automatically generated)

#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QPixmap>
#include "bmp.h"

namespace Ui {
    class Dialog;
}

class Dialog : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();

private slots:
    void on_openButton_clicked();

private:
    Ui::Dialog *ui;
    BMP srcImage;
    QImage compressedImage[3];
};

#endif // DIALOG_H

While I edit, the "public:" is underlined and says "unexpected token '('". When I try to build the program, it says in the line "Q_OBJECT", "error: expected ',' or '...' before numeric constant". I'm sure I've defined nothing related to it (to be exact, I defined an N and an n in file bmp.h, both are int).

Any idea of what's wrong here? Thanks.

© Stack Overflow or respective owner

Related posts about c++

Related posts about qt