Partage
  • Partager sur Facebook
  • Partager sur Twitter

n[Qt] Problème de compilatio MOC des slots

Anonyme
    4 septembre 2008 à 19:14:34

    Bonjour :) ,

    La compilation de mon application échoue, voici le fichier incriminé :

    #include <QApplication>
    #include <QDialog>
    #include <QVBoxLayout>
    #include <QHBoxLayout>
    #include <QFormLayout>
    
    #include <QGroupBox>
    #include <QPushButton>
    #include <QLabel>
    #include <QComboBox>
    #include <QCheckBox>
    
    #include "OptionsWin.h"
    
    OptionsWin::OptionsWin(QWidget *parent) : QDialog(parent)
    {
    	//...
    }
    
    void OptionsWin::saveConfig()
    {
    	//..
    }
    


    Et le fichier .h de la classe OptionsWin :

    class OptionsWin : public QDialog
    {
    	Q_OBJECT
    public:
    	OptionsWin(QWidget*);
    
    public slots:
    	void saveConfig();
    
    private:
    	QComboBox *_resolution;
    	QComboBox *_lang;
    	QCheckBox *_fullScreen;
    };
    


    J'ai essayé de faire qmake, make, mais ça n'a pas marché (de toute façon ce ne sont pas des erreurs vtable machin).

    Les erreurs :

    In file included from release\moc_OptionsWin.cpp:10:
    release\/../OptionsWin.h:3: error: expected class-name before '{' token
    release\/../OptionsWin.h:5: error: ISO C++ forbids declaration of `Q_OBJECT' with no type
    release\/../OptionsWin.h:5: error: expected `;' before "public"
    release\/../OptionsWin.h:8: error: expected `:' before "slots"
    release\/../OptionsWin.h:9: error: expected primary-expression before "void"
    release\/../OptionsWin.h:9: error: ISO C++ forbids declaration of `slots' with no type
    release\/../OptionsWin.h:9: error: expected `;' before "void"
    release\/../OptionsWin.h:12: error: ISO C++ forbids declaration of `QComboBox' with no type
    release\/../OptionsWin.h:12: error: expected `;' before '*' token
    release\/../OptionsWin.h:13: error: ISO C++ forbids declaration of `QComboBox' with no type
    release\/../OptionsWin.h:13: error: expected `;' before '*' token
    release\/../OptionsWin.h:14: error: ISO C++ forbids declaration of `QCheckBox' with no type
    release\/../OptionsWin.h:14: error: expected `;' before '*' token
    release\moc_OptionsWin.cpp:12:2: #error "The header file 'OptionsWin.h' doesn't include <QObject>."
    release\moc_OptionsWin.cpp:20: error: expected constructor, destructor, or type conversion before "static"
    release\moc_OptionsWin.cpp:20: error: expected `,' or `;' before "static"
    release\moc_OptionsWin.cpp:40: error: `QMetaObject' does not name a type
    release\moc_OptionsWin.cpp:45: error: expected init-declarator before '*' token
    release\moc_OptionsWin.cpp:45: error: expected `,' or `;' before '*' token
    release\moc_OptionsWin.cpp:51: error: no `void* OptionsWin::qt_metacast(const char*)' member function declared in class `OptionsWin'
    release\moc_OptionsWin.cpp: In member function `void* OptionsWin::qt_metacast(const char*)':
    release\moc_OptionsWin.cpp:53: error: `strcmp' undeclared (first use this function)
    release\moc_OptionsWin.cpp:53: error: (Each undeclared identifier is reported only once for each function it appears in.)
    release\moc_OptionsWin.cpp:55: error: `QDialog' has not been declared
    release\moc_OptionsWin.cpp:55: error: `qt_metacast' undeclared (first use this function)
    release\moc_OptionsWin.cpp: At global scope:
    release\moc_OptionsWin.cpp:58: error: `QMetaObject' has not been declared
    release\moc_OptionsWin.cpp:58: error: `int OptionsWin::qt_metacall' is not a static member of `class OptionsWin'
    release\moc_OptionsWin.cpp:58: error: `Call' was not declared in this scope
    release\moc_OptionsWin.cpp:58: error: expected primary-expression before "int"
    release\moc_OptionsWin.cpp:58: error: expected primary-expression before "void"
    release\moc_OptionsWin.cpp:59: error: initializer expression list treated as compound expression
    release\moc_OptionsWin.cpp:59: error: expected `,' or `;' before '{' token
    release\moc_OptionsWin.cpp:71: error: expected constructor, destructor, or type conversion at end of input
    release\moc_OptionsWin.cpp:71: error: expected `,' or `;' at end of input


    Merci d'avance de votre aide :)
    • Partager sur Facebook
    • Partager sur Twitter

    n[Qt] Problème de compilatio MOC des slots

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown