Bonjour,
Je rencontre des problèmes avec le code suivant, je ne comprends pas pourquoi le compilateur ne reconnaît pas les différents types alors que je les ai déclarés sur le même fichier.
Je ne vois pas de possibilité d'une boucle infinie.
J'obtient l'erreur suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 ../src/core.h:87:*error:*ISO*C++*forbids*declaration*of*'Playbox'*with*no*type ../src/core.h:87:*error:*expected*';'*before*'*'*token
alors que j'ai bien défini la classe Playbox à la ligne 29;
De plus cela arrive pour toute les classes du fichier
Merci
Voici le code complet:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92 #ifndef CORE_H #define CORE_H #define STAGING //core class SqlSaver; class Indexer; #include <QLayout> #include <QMainWindow> #include <QSplitter> #include <QStatusBar> #include <QSystemTrayIcon> //macros #include "preprocess.h" //Interfaces class PlayListInterface; class SearchLineInterface; class MetaDataInterface; class DriveInterface; class PlayingInterface; class ProgressInterface; class Updater; class DailySongInterface; class SystemTrayIcon; class Playbox; class EditInterface; class Core : public QObject { Q_OBJECT public: Core(QMainWindow*); QWidget *initInterfaces(); MetaDataInterface *metadatainterface(); //DriveInterface *driveinterface(); PlayListInterface *playlistinterface(); SearchLineInterface *searchlineinterface(); PlayingInterface *playinginterface(); ProgressInterface *progressinterface(); Playbox *playbox(); SystemTrayIcon *systemtrayicon(); Updater *updater(); SqlSaver* getSqlControl(); EditInterface* editinterface(); void place(float coef); void afterLaunch(); QString getFileContent(const QString& path); void setStatus(const QString&); QStatusBar* bar(); void scanFolders(); QMainWindow* getParent(); QStringList dictionnary(); InterfaceName interface() const; public slots: void swapInterface(InterfaceName); private: QWidget *m_central; QMainWindow *m_parent; QStatusBar* m_bar; QStringList m_dictionnary; SystemTrayIcon *m_tray; SqlSaver *sqlControl; PlayListInterface *m_playlistinterface; SearchLineInterface *m_searchlineinterface; //DriveInterface *m_driveinterface; MetaDataInterface *m_metadatainterface; PlayingInterface *m_playinginterface; ProgressInterface *m_progressinterface; // Updater *m_updater; BoutonRevenir *m_boutonrevenir; Playbox *m_playbox; EditInterface *m_editinterface; InterfaceName m_interface; }; #endif
Et voici la sortie du compilateur :
Merci et bonne journée.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 21:13:05:*Exécution*des*étapes*de*compilation*pour*le*projet*nutsh... 21:13:05:*Configuration*inchangée,*étape*QMake*sautée. 21:13:05:*Débute*:*"/usr/bin/make"*-w make:*Entering*directory*`/Users/adriencanterot/Projects/compilation' g++*-c*-pipe*-O2*-arch*x86_64*-Xarch_x86_64*-mmacosx-version-min=10.5*-Wall*-W*-DQT_DECLARATIVE_DEBUG*-DQT_NO_DEBUG*-DQT_DECLARATIVE_LIB*-DQT_SQL_LIB*-DQT_XML_LIB*-DQT_GUI_LIB*-DQT_NETWORK_LIB*-DQT_CORE_LIB*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/mkspecs/macx-g++*-I../../Projects*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/lib/QtCore.framework/Versions/4/Headers*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/include/QtCore*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/lib/QtNetwork.framework/Versions/4/Headers*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/include/QtNetwork*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/lib/QtGui.framework/Versions/4/Headers*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/include/QtGui*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/lib/QtXml.framework/Versions/4/Headers*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/include/QtXml*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/lib/QtSql.framework/Versions/4/Headers*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/include/QtSql*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/lib/QtDeclarative.framework/Versions/4/Headers*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/include/QtDeclarative*-I/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/include*-I/usr/local/include/taglib*-I/usr/local/include/fmodex*-I/usr/local/include/libvlc*-Imoc*-I../../Projects*-I.*-F/Developer/QtSdk/Desktop/Qt/4.8.0/gcc/lib*-o*obj/mainwindow.o*../src/mainwindow.cpp In*file*included*from*../src/mainwindow.cpp:5: ../src/core.h:43:*error:*ISO*C++*forbids*declaration*of*'MetaDataInterface'*with*no*type ../src/core.h:43:*error:*expected*';'*before*'*'*token ../src/core.h:47:*error:*ISO*C++*forbids*declaration*of*'PlayingInterface'*with*no*type ../src/core.h:47:*error:*expected*';'*before*'*'*token ../src/core.h:48:*error:*ISO*C++*forbids*declaration*of*'ProgressInterface'*with*no*type ../src/core.h:48:*error:*expected*';'*before*'*'*token ../src/core.h:49:*error:*ISO*C++*forbids*declaration*of*'Playbox'*with*no*type ../src/core.h:49:*error:*expected*';'*before*'*'*token ../src/core.h:82:*error:*ISO*C++*forbids*declaration*of*'MetaDataInterface'*with*no*type ../src/core.h:82:*error:*expected*';'*before*'*'*token ../src/core.h:83:*error:*ISO*C++*forbids*declaration*of*'PlayingInterface'*with*no*type ../src/core.h:83:*error:*expected*';'*before*'*'*token ../src/core.h:84:*error:*ISO*C++*forbids*declaration*of*'ProgressInterface'*with*no*type ../src/core.h:84:*error:*expected*';'*before*'*'*token ../src/core.h:86:*error:*ISO*C++*forbids*declaration*of*'BoutonRevenir'*with*no*type ../src/core.h:86:*error:*expected*';'*before*'*'*token ../src/core.h:87:*error:*ISO*C++*forbids*declaration*of*'Playbox'*with*no*type ../src/core.h:87:*error:*expected*';'*before*'*'*token ../src/mainwindow.cpp:*In*constructor*'MainWindow::MainWindow(QWidget*)': ../src/mainwindow.cpp:25:*error:*'class*Core'*has*no*member*named*'metadatainterface' make:*****[obj/mainwindow.o]*Error*1 make:*Leaving*directory*`/Users/adriencanterot/Projects/compilation' 21:13:09:*Le*processus*"/usr/bin/make"*s'est*terminé*avec*le*code*2. Erreur*à*la*compilation*du*projet*nutsh*(cible*:*Desktop) Lors*de*l'exécution*de*l'étape*"Make"
Partager