Bon voila le début de ma classe :
SIG.hpp
Code :
- #include <string.h>
- #include <gtk/gtk.h> // pour l'utilisation de GTK
- #include <stdio.h>
- class SIG {
- public :
|
le fichier SIG.cpp
Code :
- #include <gtk/gtk.h> // pour l'utilisation de GTK
- #include "SIG.hpp"
|
et quand je compile avec :
Code :
- clear
- g++ -c $1 `gtk-config --cflags --libs`
|
il m'envoie boulait en me disant :
Code :
- [kerdreux@localhost CodeObjet]$ CompClasse SIG.cpp > essaie.txt
- In file included from SIG.cpp:23:
- SIG.hpp:106: error: `bool& SIG::operator!=(const SIG&, const SIG& )' must take exactly one argument
- SIG.cpp:29: error: semicolon missing after declaration of `SIG'
- SIG.hpp: In constructor `SIG::SIG()':
- SIG.hpp:49: error: syntax error before `void'
- SIG.hpp:49: error: `gtk_dialog_new_with_buttons' undeclared (first use this function)
- SIG.hpp:49: error: (Each undeclared identifier is reported only once for each function it appears in.)
- SIG.hpp:49: error: syntax error before `void'
- SIG.hpp:56: error: `pNomSaisie' undeclared (first use this function)
- SIG.hpp:67: error: `gtk_dialog_run' undeclared (first use this function)
- SIG.hpp:68: error: syntax error before `void'
- SIG.hpp:76: error: `GTK_RESPONSE_CANCEL' undeclared (first use this function)
- SIG.hpp:76: error: case label `<expression error>' not within a switch statement
- SIG.hpp:77: error: `GTK_RESPONSE_NONE' undeclared (first use this function)
- SIG.hpp:77: error: case label `<expression error>' not within a switch statement
- SIG.hpp:78: error: `default' label not within a switch statement
- SIG.hpp: At global scope:
- SIG.hpp:82: error: parse error at end of saved function text
- SIG.cpp:29: error: ISO C++ forbids defining types within return type
- SIG.cpp:29: error: syntax error before `&' token
- SIG.cpp:37: error: ISO C++ forbids declaration of `Nom_SIG' with no type
- SIG.cpp:37: error: `s' was not declared in this scope
- SIG.cpp:38: error: `s' was not declared in this scope
- SIG.cpp:38: error: ISO C++ forbids declaration of `strcpy' with no type
- SIG.cpp:38: error: `int strcpy' redeclared as different kind of symbol
- /usr/include/string.h:83: error: previous declaration of `char* strcpy(char*, const char*)'
- SIG.cpp:38: error: initializer list being treated as compound expression
- SIG.cpp:39: error: ISO C++ forbids declaration of `Emplacement_SIG' with no type
- SIG.cpp:39: error: `s' was not declared in this scope
- SIG.cpp:40: error: `s' was not declared in this scope
- SIG.cpp:40: error: ISO C++ forbids declaration of `strcpy' with no type
- SIG.cpp:40: error: redefinition of `int strcpy'
- SIG.cpp:38: error: `int strcpy' previously defined here
- SIG.cpp:40: error: initializer list being treated as compound expression
- SIG.cpp:41: error: syntax error before `}' token
- SIG.hpp: In function `bool& operator!=(const SIG&, const SIG& )':
- SIG.hpp:118: error: `char*SIG::Nom_SIG' is private
- SIG.cpp:48: error: within this context
- SIG.hpp:118: error: `char*SIG::Nom_SIG' is private
- SIG.cpp:48: error: within this context
- SIG.hpp:119: error: `char*SIG::Emplacement_SIG' is private
- SIG.cpp:48: error: within this context
- SIG.hpp:119: error: `char*SIG::Emplacement_SIG' is private
- SIG.cpp:48: error: within this context
- SIG.cpp: In function `char* LireNom_SIG()':
- SIG.cpp:69: error: invalid conversion from `int' to `char*'
- SIG.cpp: In function `char* LireEmplacement_SIG()':
- SIG.cpp:75: error: invalid conversion from `int' to `char*'
- SIG.cpp: In function `void ModifierNom_SIG(const char*)':
- SIG.cpp:81: error: type `int' argument given to `delete', expected pointer
- SIG.cpp:82: error: invalid conversion from `char*' to `int'
- SIG.cpp:83: error: `strcpy' cannot be used as a function
- SIG.cpp: In function `void ModifierEmplacement_SIG(const char*)':
- SIG.cpp:89: error: type `int' argument given to `delete', expected pointer
- SIG.cpp:90: error: invalid conversion from `char*' to `int'
- 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
quelqu'un aurait une idée ???
Merci beaucoup !