1 pièce(s) jointe(s)
[Débutant] Inclusion et héritage.
Bonsoir.
J'ai décidé de me lancer dans la réalisation d'un petit jeu en C++ (si je poste ici et non dans le forum jeux, c'est que mon problème n'est en rien lié au jeu lui même). J'ai donc mis en place une structure de base, m'inspirant fortement de celle de http://khayyam.developpez.com/articl.../architecture/.
Après la création de cette base, j'ai voulu la compiler. Mais j'ai toujours un certain nombre d'erreurs dont je ne parvient pas à trouver l'origine. J'utilise CodeBlocks 1.0.
Rapport d'erreur :
Code:
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
| Compiler : GNU GCC Compiler (called directly)
Directory : G:\usr\C\Projet2\C++\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: Engine.cpp
In file included from Game.h:7,
from Engine.h:10,
from Engine.cpp:2:
Engine_Game.h:10: error: expected class-name before '{' token
Engine_Game.h:12: error: expected `)' before '*' token
Engine_Game.h:15: error: `Engine_event' has not been declared
Engine_Game.h:15: error: ISO C++ forbids declaration of `parameter' with no type
In file included from Game.h:8,
from Engine.h:10,
from Engine.cpp:2:
Engine_Graphics.h:11: error: expected class-name before '{' token
Engine_Graphics.h:13: error: expected `)' before '*' token
Engine_Graphics.h:16: error: `Engine_event' has not been declared
Engine_Graphics.h:16: error: ISO C++ forbids declaration of `parameter' with no type
Engine.cpp: In member function `void Engine::m_send_message_to_game(Engine_event&)':
Engine.cpp:27: error: 'class Game_engine' has no member named 'push_event'
Engine.cpp: In member function `void Engine::m_send_message_to_graphics(Engine_event&)':
Engine.cpp:32: error: 'class Graphics_engine' has no member named 'push_event'
Process terminated with status 1 (0 minutes, 1 seconds)
10 errors, 0 warnings |
Le (les ?) problèmes ne doivent pas être bien méchant, mais je n'arrive pas à les trouver. J'ai l'impression que les différentes classes n'arrivent pas à se reconnaitre, d'où les problèmes notamment d'héritage. J'ai bien vérifié mes #include, mais ça ne semble pas venir de là.
Merci de votre aide.