Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2305 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  [GTK & C++] compilation de classe avec erreur

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[GTK & C++] compilation de classe avec erreur

n°908383
lordankou
Posté le 26-11-2004 à 12:48:37  profilanswer
 

Bon voila le début de ma classe :
 
SIG.hpp

Code :
  1. #include <string.h>
  2. #include <gtk/gtk.h> // pour l'utilisation de GTK
  3. #include <stdio.h>
  4. class SIG {
  5. public :


 
le fichier SIG.cpp
 

Code :
  1. #include <gtk/gtk.h> // pour l'utilisation de GTK
  2. #include "SIG.hpp"


 
et quand je compile avec :
 

Code :
  1. clear
  2. g++ -c $1 `gtk-config --cflags --libs`


 
il m'envoie boulait en me disant :
 

Code :
  1. [kerdreux@localhost CodeObjet]$ CompClasse SIG.cpp > essaie.txt
  2. In file included from SIG.cpp:23:
  3. SIG.hpp:106: error: `bool& SIG::operator!=(const SIG&, const SIG& )' must take exactly one argument
  4. SIG.cpp:29: error: semicolon missing after declaration of `SIG'
  5. SIG.hpp: In constructor `SIG::SIG()':
  6. SIG.hpp:49: error: syntax error before `void'
  7. SIG.hpp:49: error: `gtk_dialog_new_with_buttons' undeclared (first use this function)
  8. SIG.hpp:49: error: (Each undeclared identifier is reported only once for each function it appears in.)
  9. SIG.hpp:49: error: syntax error before `void'
  10. SIG.hpp:56: error: `pNomSaisie' undeclared (first use this function)
  11. SIG.hpp:67: error: `gtk_dialog_run' undeclared (first use this function)
  12. SIG.hpp:68: error: syntax error before `void'
  13. SIG.hpp:76: error: `GTK_RESPONSE_CANCEL' undeclared (first use this function)
  14. SIG.hpp:76: error: case label `<expression error>' not within a switch statement
  15. SIG.hpp:77: error: `GTK_RESPONSE_NONE' undeclared (first use this function)
  16. SIG.hpp:77: error: case label `<expression error>' not within a switch statement
  17. SIG.hpp:78: error: `default' label not within a switch statement
  18. SIG.hpp: At global scope:
  19. SIG.hpp:82: error: parse error at end of saved function text
  20. SIG.cpp:29: error: ISO C++ forbids defining types within return type
  21. SIG.cpp:29: error: syntax error before `&' token
  22. SIG.cpp:37: error: ISO C++ forbids declaration of `Nom_SIG' with no type
  23. SIG.cpp:37: error: `s' was not declared in this scope
  24. SIG.cpp:38: error: `s' was not declared in this scope
  25. SIG.cpp:38: error: ISO C++ forbids declaration of `strcpy' with no type
  26. SIG.cpp:38: error: `int strcpy' redeclared as different kind of symbol
  27. /usr/include/string.h:83: error: previous declaration of `char* strcpy(char*, const char*)'
  28. SIG.cpp:38: error: initializer list being treated as compound expression
  29. SIG.cpp:39: error: ISO C++ forbids declaration of `Emplacement_SIG' with no type
  30. SIG.cpp:39: error: `s' was not declared in this scope
  31. SIG.cpp:40: error: `s' was not declared in this scope
  32. SIG.cpp:40: error: ISO C++ forbids declaration of `strcpy' with no type
  33. SIG.cpp:40: error: redefinition of `int strcpy'
  34. SIG.cpp:38: error: `int strcpy' previously defined here
  35. SIG.cpp:40: error: initializer list being treated as compound expression
  36. SIG.cpp:41: error: syntax error before `}' token
  37. SIG.hpp: In function `bool& operator!=(const SIG&, const SIG& )':
  38. SIG.hpp:118: error: `char*SIG::Nom_SIG' is private
  39. SIG.cpp:48: error: within this context
  40. SIG.hpp:118: error: `char*SIG::Nom_SIG' is private
  41. SIG.cpp:48: error: within this context
  42. SIG.hpp:119: error: `char*SIG::Emplacement_SIG' is private
  43. SIG.cpp:48: error: within this context
  44. SIG.hpp:119: error: `char*SIG::Emplacement_SIG' is private
  45. SIG.cpp:48: error: within this context
  46. SIG.cpp: In function `char* LireNom_SIG()':
  47. SIG.cpp:69: error: invalid conversion from `int' to `char*'
  48. SIG.cpp: In function `char* LireEmplacement_SIG()':
  49. SIG.cpp:75: error: invalid conversion from `int' to `char*'
  50. SIG.cpp: In function `void ModifierNom_SIG(const char*)':
  51. SIG.cpp:81: error: type `int' argument given to `delete', expected pointer
  52. SIG.cpp:82: error: invalid conversion from `char*' to `int'
  53. SIG.cpp:83: error: `strcpy' cannot be used as a function
  54. SIG.cpp: In function `void ModifierEmplacement_SIG(const char*)':
  55. SIG.cpp:89: error: type `int' argument given to `delete', expected pointer
  56. SIG.cpp:90: error: invalid conversion from `char*' to `int'
  57. SIG.cpp:91: error: `strcpy' cannot be used as a function


 
bon pour l'instant les erreurs que je voudrais résoudre ça serrait celle en rapport avec le GTK.
 
quand je compile mon programme main.cpp qui utilise GTK il le fait très bien. par contre dés que j'utilise une classe il n'a pas l'air de trouver le fichier gtk.h ou il y a tout les déclarations.
 
j'ai bo retourné le problème dans tous les sens, notamment au niveau des includes en indiquant le chemin complet vers gtk.h mais là c l'enfer il affiche des erreurs dans le fichier gtk.h  :pt1cable:  
 
quelqu'un aurait une idée ???  :??:  
 
Merci beaucoup !

mood
Publicité
Posté le 26-11-2004 à 12:48:37  profilanswer
 

n°908392
Lam's
Profil: bas.
Posté le 26-11-2004 à 13:04:16  profilanswer
 

Donne ta classe (le .hpp), ça ira plus vite. T'es sûr d'avoir mis un ';' à la fin ?

Code :
  1. class SIG
  2. {
  3.     blablabla
  4. };


n°908420
lordankou
Posté le 26-11-2004 à 13:18:00  profilanswer
 

en effet j'ai oublié le ; à la fin de la déclaration de ma classe !
 
je pouvais tjrs chercher j'aurais jamais pensé à ça !  
merci bcp monsieur vais compiler dans la soirée et je vous tiens au courant !! mici bcp !


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  [GTK & C++] compilation de classe avec erreur

 

Sujets relatifs
Probleme avec une classe que j'ai herité[C] erreur de bibliotheque
retour erreur de la fonction php mail()Probleme erreur Tomcat
compilation d'une couche Ethernet modifiée sur linuxErreur 500 --> .htaccess
[jsp]problème à la compilation : class file contains wrong classun map<> static dans une classe ?
[DevC++] problème de compilation avec des templatesMessage d'erreur en C++
Plus de sujets relatifs à : [GTK & C++] compilation de classe avec erreur


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR