Constructeur dans application

andarius40 Messages postés 12 Date d'inscription mardi 22 juin 2004 Statut Membre Dernière intervention 24 novembre 2005 - 24 juin 2004 à 22:55
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 - 25 juin 2004 à 09:08
bonjour

j'ai deja poste ce message mais ne trouvant toujours pas la solutions je tente de le reposter.

j'apprends le c++ avec le livre visual c++ 6 de ivor horton.
(J'en suis au chapitre 6 pour ceux qui ont le livre)

Lorsque je compile le programme j'ai des erreurs. Les voicis

Compiling...
Elements.cpp
e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2143: syntax error : missing ';' before '<'

e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2501: 'CList' : missing storage-class or type specifiers

e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2059: syntax error : '<'

e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2238: unexpected token(s) preceding ';'

E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(135)
: error C2065: 'm_PointList' : undeclared identifier

E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(135)
: error C2228: left of '.AddTail' must have class/struct/union type

E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(136)
: error C2228: left of '.AddTail' must have class/struct/union type

E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(147)
: error C2228: left of '.AddTail' must have class/struct/union type

E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(172)
: error C2228: left of '.GetHeadPosition' must have class/struct/union type
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(176)
: error C2228: left of '.GetNext' must have class/struct/union type
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(180)
: error C2228: left of '.GetNext' must have class/struct/union type
SketcherView.cpp

e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2143: syntax error : missing ';' before '<'

e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2501: 'CList' : missing storage-class or type specifiers

e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2059: syntax error : '<'

e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2238: unexpected token(s) preceding ';'

Generating Code...
Error executing cl.exe.

Sketcher.exe - 15 error(s), 0 warning(s)

ereurs dans fichiers

elements.h

CList<CPoint, const CPoint&> m_PointList; // Liste de points Type safe

elements.cpp

m_PointList.AddTail(FirstPoint); // Ajoute le 1er point dans la liste
m_PointList.AddTail(SecondPoint); // Ajoute le 2nd point dans la liste

m_PointList.AddTail(Point); // Ajoute le point à la fin

POSITION aPosition = m_PointList.GetHeadPosition();

pDC->MoveTo(m_PointList.GetNext(aPosition));

pDC->LineTo(m_PointList.GetNext(aPosition))

voila j'ai bien mis include# dans StdAfh.h

Si quelqu'un peut m'aider je peut envoyer l'application complete par mail pour trouver l'erreur.

merci de vos reponses

1 réponse

cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
25 juin 2004 à 09:08
Salut,

Très bon choix d'avoir pris le livre d'Ivor Horton, c'est ce bouquin qui m'a permis de comprendre bien des choses en C++ puis en VC++ avec les MFC !

Apparement, tes erreurs de compilations viennent d'une erreur de syntaxe, auras-tu oublié une lettre ? une majuscule ? un point-virgule ?

C'est surtout cette ligne : "e:\c++\chapitre16\exemple\sketcher\elements.h(82)
: error C2143: syntax error : missing ';' before '<'" qui indique cà ! Après, les autres erreurs sont de même un nom d'objet non identifié : "E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(135)
: error C2228: left of '.AddTail' must have class/struct/union type" => surement un problème de majuscule ou de lettre oublié.

Regarde bien ton code et compare le au code du livre !

Sinon, tu en est déjà au développement de l'exemple sketcher alors que tu en est au chapitre 6 ??? Tu saute des étapes là, non ?

DarK Sidious

[Responsable API/VB du site www.ProgOtoP.com]
Téléchargez ProgOtoP API Viewer
0
Rejoignez-nous