NiJuste
Messages postés8Date d'inscriptionlundi 5 décembre 2005StatutMembreDernière intervention 1 mars 2010
-
14 juin 2008 à 12:42
luhtor
Messages postés2023Date d'inscriptionmardi 24 septembre 2002StatutMembreDernière intervention28 juillet 2008
-
16 juin 2008 à 22:03
Avec ce petit code j'ai beaucoup d'erreurs de compilation et ca m'empeche de continuer. Aider moi sur vous plait
--------------------Configuration: test - Win32 Debug--------------------
Compiling...
dfd.cpp
E:\aec\test\dfd.cpp(12) : error C2143: syntax error : missing ';' before '<'
E:\aec\test\dfd.cpp(74) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(12) : error C2501: 'list' : missing storage-class or type specifiers
E:\aec\test\dfd.cpp(74) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(12) : error C2059: syntax error : '<'
E:\aec\test\dfd.cpp(74) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(12) : error C2238: unexpected token(s) preceding ';'
E:\aec\test\dfd.cpp(74) : see reference to class template instantiation 'Ring<T>' being compiled
Error executing cl.exe.
cs_rt15
Messages postés3874Date d'inscriptionmardi 8 mars 2005StatutModérateurDernière intervention 7 novembre 201413 14 juin 2008 à 23:17
En fait avec ton namespace std{}, c'est comme si tu contribuais au namespace standard du C++.
Comme si tu faisais du code destiné à être utilisé par tous les développeurs C++ et livré avec tous les compilo.
Donc vire le.
gcc est nettement plus tatillon que le compilo fournit avec VS. Un code VS ne compile pas souvent sous gcc, mais l'inverse est quasi systématique.
Donc je me permet d'insister : Le problème n'est probablement pas dans CE fichier.
(Ou alors une sombre histoire d'encodage du fichier... Nan mais nan)
NiJuste
Messages postés8Date d'inscriptionlundi 5 décembre 2005StatutMembreDernière intervention 1 mars 2010 14 juin 2008 à 22:55
En fait le probleme ce que , je veux creer mon propre container a base de STL,
avec l'algorithme que j'ai utilise on me donne des erreurs de
compilation ( en Visual C++ 6.0). Aidez-moi a resourdre ce probleme.
Ca c'est l'agorithme utilise,
#include
#include <list>
#include <string>
usingnamespace std;
--------------------Configuration: test - Win32 Debug--------------------
Compiling...
dfd.cpp
E:\aec\test\dfd.cpp(10) : error C2143: syntax error : missing ';' before '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(10) : error C2501: 'list' : missing storage-class or type specifiers
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(10) : error C2059: syntax error : '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(10) : error C2238: unexpected token(s) preceding ';'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(17) : error C2039: 'iterator' : is not a member of 'std'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(17) : error C2504: 'iterator' : base class undefined
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(17) : error C2143: syntax error : missing ',' before '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(17) : error C2059: syntax error : '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(18) : error C2039: 'bidirectional_iterator_tag' : is not a member of 'std'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(19) : error C2143: syntax error : missing ';' before '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(19) : error C2501: 'list' : missing storage-class or type specifiers
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(19) : error C2059: syntax error : '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(19) : error C2039: 'iterator' : is not a member of '`global namespace''
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(19) : error C2238: unexpected token(s) preceding ';'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(20) : error C2143: syntax error : missing ';' before '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(20) : error C2501: 'list' : missing storage-class or type specifiers
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(20) : error C2059: syntax error : '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(20) : error C2238: unexpected token(s) preceding ';'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(24) : error C2039: 'iterator' : is not a member of '`global namespace''
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(23) : error C2629: unexpected 'class Ring<T>::iterator ('
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(23) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(32) : error C2143: syntax error : missing ';' before '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(32) : error C2501: 'list' : missing storage-class or type specifiers
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(32) : error C2059: syntax error : '<'
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(32) : error C2039: 'reference' : is not a member of '`global namespace''
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
E:\aec\test\dfd.cpp(32) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
E:\aec\test\dfd.cpp(71) : see reference to class template instantiation 'Ring<T>' being compiled
Error executing cl.exe.
NiJuste
Messages postés8Date d'inscriptionlundi 5 décembre 2005StatutMembreDernière intervention 1 mars 2010 15 juin 2008 à 13:27
Merci bcp pour vos reponses, elles m'aident enormement.
j'ai compile ca en VC++ 6.0, mais je sais pas si c'est un probleme de VC++ 6.0 ou bien une mauvaise utilisation de ma part, on dirait que le visual 6.0 ne reconnait pas les "using namespace std;" , je l'ai enleve et devant chaque "list", j'ai du ajoute le mot "std::", et les erreurs on disparu
NiJuste
Messages postés8Date d'inscriptionlundi 5 décembre 2005StatutMembreDernière intervention 1 mars 2010 15 juin 2008 à 13:32
et le seul probleme qui me reste maintenant ce qu'en declarant
typedef DFD<Element>::iterator It;
It it;
j'ai encore une erreur de compilation
e:\aec\analyseur d expression complexe\definition.h(131) : error C2512: 'iterator' : no appropriate default constructor available.