Bnojour a tous,
Je sais qu'il y a pleins de sujets la dessus mais je l'ai ai lu et j'ai essayé d'appliquer les reponses qui ont resolu les problemes des autres mais pas le mien
Voila je suis sous Debian et programme sous eclipse avec g++
erreur du compimlateur :
et voila le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 ../CKClassification.cpp:78:1: error: pasting "CKCLassification" and "::" does not give a valid preprocessing token ../CKClassification.cpp:78:1: error: pasting "::" and "name" does not give a valid preprocessing token ../CKClassification.cpp:78:1: error: pasting "CKCLassification" and "::" does not give a valid preprocessing token ../CKClassification.cpp:78:1: error: pasting "::" and "set" does not give a valid preprocessing token ../CKClassification.cpp:83:1: error: pasting "CKCLassification" and "::" does not give a valid preprocessing token ../CKClassification.cpp:83:1: error: pasting "::" and "parent" does not give a valid preprocessing token ../CKClassification.cpp:83:1: error: pasting "CKCLassification" and "::" does not give a valid preprocessing token ../CKClassification.cpp:83:1: error: pasting "::" and "set" does not give a valid preprocessing token ../CKClassification.cpp:84:1: error: pasting "CKCLassification" and "::" does not give a valid preprocessing token ../CKClassification.cpp:84:1: error: pasting "::" and "subClassifications" does not give a valid preprocessing token ../CKClassification.cpp:84:1: error: pasting "CKCLassification" and "::" does not give a valid preprocessing token ../CKClassification.cpp:84:1: error: pasting "::" and "get" does not give a valid preprocessing token
Et voila la definition de la maccro:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 /*--- Attributs - Main --------------------------------------------------------------------------*/ __FIELD_PRIMITIVE_DEFINITION(CKCLassification, engr::wstring, name, Name); // ligne 78 /*--- Attributs - Sub-classifications -----------------------------------------------------------*/ __FIELD_COMPOSITE_ADRESS_DEFINITION(CKCLassification, CKCLassification, parent, Parent); // ligne 83 __FIELD_VECTOR_COMPOSITE_DEFINITION(CKCLassification, CKCLassification, subClassifications, SubClassifications); //ligne 84
J'espere que quelqu'un pourra m'eclairer car ca me permettrai de resoudre mon probleme et aussi de comprendre le principe des defines car jusqu'a la les defines se resumaient pour moi a : #define width 3
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 #define __FIELD_PRIMITIVE_DECLARATION(TYPE, NAME, FUNCTION_NAME) \ protected: \ TYPE _##NAME; \ public: \ TYPE NAME() const; \ void set##FUNCTION_NAME(const TYPE NAME); \ #define __FIELD_PRIMITIVE_DEFINITION(CLASS, TYPE, NAME, FUNCTION_NAME) engr::#TYPE \ TYPE CLASS##::##NAME() const \ { \ return this->_##NAME; \ } \ \ void CLASS##::##set##FUNCTION_NAME(const TYPE NAME) \ { \ this->_##NAME = NAME; \ } \ #define __FIELD_COMPOSITE_ADRESS_DECLARATION(TYPE, NAME, FUNCTION_NAME) \ protected: \ engr::TKPointer< TYPE > _##NAME; \ public: \ engr::TKPointer< TYPE > NAME() const; \ void set##FUNCTION_NAME(const engr::TKPointer< TYPE > NAME); \ #define __FIELD_COMPOSITE_ADRESS_DEFINITION(CLASS, TYPE, NAME, FUNCTION_NAME) \ engr::TKPointer< TYPE > CLASS##::##NAME() const \ { \ return this->_##NAME; \ } \ \ void CLASS##::##set##FUNCTION_NAME(const engr::TKPointer< TYPE > NAME) \ { \ this->_##NAME = NAME; \ } \ #define __FIELD_VECTOR_COMPOSITE_DECLARATION(TYPE, NAME, FUNCTION_NAME) \ protected: \ engr::vector< TYPE > _##NAME; \ public: \ const engr::vector< TYPE >& NAME() const; \ engr::vector< TYPE >& get##FUNCTION_NAME(); \ #define __FIELD_VECTOR_COMPOSITE_DEFINITION(CLASS, TYPE, NAME, FUNCTION_NAME) \ const engr::vector< TYPE >& CLASS##::##NAME() const \ { \ return this->_##NAME; \ } \ \ engr::vector< TYPE >& CLASS##::##get##FUNCTION_NAME() \ { \ return this->_##NAME; \ } \ #endif
Merci encore.
Partager