[RESOLU] Erreur à la compilation :(

Erreur à la compilation :( [RESOLU] - C++ - Programmation

Marsh Posté le 23-03-2010 à 00:17:24    

Bonsoir,
 
Voila j'ai une erreur à la compilation de mon programme.
Pouvez vous m'aider ?
 
http://www.yionel.fr/pastebin/index.php/view/86559087


Message édité par Yionel le 23-03-2010 à 12:05:06
Reply

Marsh Posté le 23-03-2010 à 00:17:24   

Reply

Marsh Posté le 23-03-2010 à 07:57:56    

si tu poster au moins les bons fichiers avec les lignes incriminées ca serait plus simple à deviner hein :o

Reply

Marsh Posté le 23-03-2010 à 08:11:35    

euh je ne sais pas trop ce que j'ai oublié...  [:cerveau foudtag]  
 
J'ai rajouté des fichiers mais je ne sais pas si ça va être utile...  
http://www.yionel.fr/pastebin/index.php/view/94311788

Reply

Marsh Posté le 23-03-2010 à 08:15:43    

Je vote pour une erreur dans objet.h, dont on ne dispose pas. Au hasard une accolade oubliée.

Reply

Marsh Posté le 23-03-2010 à 10:39:42    

Elmoricq a écrit :

Je vote pour une erreur dans objet.h, dont on ne dispose pas. Au hasard une accolade oubliée.


 
Bah objet.h est présent  [:cerveau fang fung]  
Et non l'erreur n'est pas si simple hélas  [:cerveau totoz]

Reply

Marsh Posté le 23-03-2010 à 10:45:35    

Tu inclus objet.h dans fonctions.h et dans fonctions.cpp

Reply

Marsh Posté le 23-03-2010 à 10:46:14    

Pourquoi tu includes "fonctions.h" dans "objets.h"?

Reply

Marsh Posté le 23-03-2010 à 10:48:42    

objet.h se sert des types Point et Vecteur, et pourtant on y voit ni #include "Point.h" ni #include "Vecteur.h".

Reply

Marsh Posté le 23-03-2010 à 10:58:13    

Bon ok je me rends lol.
Cette programme est celui d'un copain. J'essais de l'aider, j'ai regardé pourquoi ça ne compilait pas et j'ai pas compris aussi pourquoi yavait des incluide un peu dans tous les sens :D

Reply

Marsh Posté le 23-03-2010 à 11:01:08    

snafu8 a écrit :

Pourquoi tu includes "fonctions.h" dans "objets.h"?


Voici ce que ça conne si je vire #include "fonctions.h" :  

Code :
  1. yo@yo-laptop:~/Downloads/Mécanique Céleste$ make
  2. In file included from fonctions.h:4,
  3.                  from objet.cpp:1:
  4. objet.h:15: error: ‘Point’ does not name a type
  5. objet.h:16: error: ‘Vecteur’ does not name a type
  6. objet.h:19: error: ‘Vecteur’ does not name a type
  7. objet.h:20: error: ‘Vecteur’ does not name a type
  8. objet.h:23: error: ISO C++ forbids declaration of ‘Point’ with no type
  9. objet.h:23: error: expected ‘,’ or ‘...’ before ‘&’ token
  10. objet.h:25: error: ISO C++ forbids declaration of ‘Point’ with no type
  11. objet.h:25: error: expected ‘,’ or ‘...’ before ‘&’ token
  12. objet.h:26: error: ISO C++ forbids declaration of ‘Vecteur’ with no type
  13. objet.h:26: error: expected ‘,’ or ‘...’ before ‘&’ token
  14. objet.h:29: error: ‘Vecteur’ has not been declared
  15. objet.h:30: error: ‘Vecteur’ has not been declared
  16. objet.h:32: error: ‘Point’ does not name a type
  17. objet.h:33: error: ‘Vecteur’ does not name a type
  18. objet.cpp: In constructor ‘objetr::objetr()’:
  19. objet.cpp:16: error: ‘P’ was not declared in this scope
  20. objet.cpp: At global scope:
  21. objet.cpp:21: error: prototype for ‘objetr::objetr(const Point&, const Vecteur&, const double& )’ does not match any in class ‘objetr’
  22. objet.h:24: error: candidates are: objetr::objetr(const objetr& )
  23. objet.h:23: error:                 objetr::objetr(int)
  24. objet.cpp:13: error:                 objetr::objetr()
  25. objet.cpp: In copy constructor ‘objetr::objetr(const objetr& )’:
  26. objet.cpp:30: error: ‘P’ was not declared in this scope
  27. objet.cpp:30: error: ‘const class objetr’ has no member named ‘P’
  28. objet.cpp:31: error: ‘V’ was not declared in this scope
  29. objet.cpp:31: error: ‘const class objetr’ has no member named ‘V’
  30. objet.cpp: At global scope:
  31. objet.cpp:35: error: prototype forvoid objetr::position(const Point& )’ does not match any in class ‘objetr’
  32. objet.h:25: error: candidate is: void objetr::position(int)
  33. objet.cpp:40: error: prototype forvoid objetr::vitesse(const Vecteur& )’ does not match any in class ‘objetr’
  34. objet.h:26: error: candidate is: void objetr::vitesse(int)
  35. objet.cpp:55: error: no ‘Point objetr::Position()’ member function declared in class ‘objetr’
  36. objet.cpp:65: error: prototype forvoid objetr::VecteurForce(Vecteur)’ does not match any in class ‘objetr’
  37. objet.h:29: error: candidate is: void objetr::VecteurForce(int)
  38. objet.cpp:74: error: prototype forvoid objetr::VecteurAcceleration(Vecteur)’ does not match any in class ‘objetr’
  39. objet.h:30: error: candidate is: void objetr::VecteurAcceleration(int)
  40. objet.cpp:79: error: no ‘Vecteur objetr::getForce()’ member function declared in class ‘objetr’
  41. objet.cpp: In member function ‘void objetr::RK1(double, int, int, objetr*, const int& )’:
  42. objet.cpp:122: error: ‘acceleration’ was not declared in this scope
  43. objet.cpp:123: error: ‘V’ was not declared in this scope
  44. objet.cpp:124: error: ‘P’ was not declared in this scope
  45. make: *** [objet.o] Error 1

Reply

Marsh Posté le 23-03-2010 à 11:01:08   

Reply

Marsh Posté le 23-03-2010 à 11:02:18    

Kenelm a écrit :

objet.h se sert des types Point et Vecteur, et pourtant on y voit ni #include "Point.h" ni #include "Vecteur.h".


Hum si j'inclus comme tu dis point et vecteur dans objet.h :

Code :
  1. yo@yo-laptop:~/Downloads/Mécanique Céleste$ make
  2. fonctions.cpp: In function ‘void CalculForceAcceleration(objetr*, const int& )’:
  3. fonctions.cpp:36: error: ‘G’ was not declared in this scope
  4. make: *** [fonctions.o] Error 1

 [:cerveau neuf]
 
L'erreur ligne 36, c'est la ligne :
F = - G * o[i].Masse()*o[j].Masse()/ (Rij*Rij); //calcul de la force
 
http://www.yionel.fr/pastebin/index.php/view/46627767
 
Merci pour votre aide, c'est génial  [:cerveau jap]


Message édité par Yionel le 23-03-2010 à 11:13:19
Reply

Marsh Posté le 23-03-2010 à 11:17:28    

Ben y dit que G est pas déclaré, ça doit pas être dur à vérifier :D

Reply

Marsh Posté le 23-03-2010 à 11:28:16    

ca te trouerais le derch d'uploader TOUS les fichiers plutot qu'on joue au devinettes ...

Reply

Marsh Posté le 23-03-2010 à 11:59:59    

Joel F a écrit :

ca te trouerais le derch d'uploader TOUS les fichiers plutot qu'on joue au devinettes ...


Tu as besoin de quoi de plus ?  [:cerveau klem]

Reply

Marsh Posté le 23-03-2010 à 12:02:46    

ok merci j'ai déclaré ma variable dans fonctions.cpp et non dans la fonction main() de main.cpp  
 
Ca compile ! :-)

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed