IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Visual C++ Discussion :

Impossible d'appeler begin() ou end()


Sujet :

Visual C++

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre extrêmement actif
    Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2008
    Messages
    1 022
    Détails du profil
    Informations personnelles :
    Localisation : France, Mayenne (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Décembre 2008
    Messages : 1 022
    Par défaut Impossible d'appeler begin() ou end()
    Bonjour,
    J'ai maintenant un problème de compilation dans un code qui plante à l’exécution:
    je suis passé par ce code la première fois sans problème.
    je vous met le code, les déclarations du header, et les erreurs:
    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
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
      switch (TypeOfPreviousWord)
      {
      case CHUNKTYPE_NOUN:
        itPosNoun = std::find( m_ListPosNoun.begin(), m_ListPosNoun.end(), pWord->POS);
        if(itPosNoun != m_ListPosNoun.end())
        {
          IsSameChunkType = true;
        }
        break;
      case CHUNKTYPE_VERB:
        itPosVerb = std::find(m_ListPosVerb.begin(), m_ListPosVerb.end(), pWord->POS);
        if(itPosVerb != m_ListPosVerb.end())
        {
          IsSameChunkType = true;
        }
        break;
      case CHUNKTYPE_FUNCT:
        itPosFunct = std::find(m_ListPosFunct.begin(), m_ListPosFunct.end(), pWord->POS);
        if(itPosFunct != m_ListPosFunct.end())
        {
          IsSameChunkType = true;
        }
        break;
    le Header:
    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
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    /*******************************************************************************
    * NOM: Chunker.h
    * ROLE:
    * HISTORIQUE:
    * 05/05/2003, yab, initial version
    *******************************************************************************/
    #ifndef CHUNKER_H
    #define CHUNKER_H
    /*_____INCLUDE-FILES__________________________________________________________*/
     
     
     
    /*_____GLOBAL-DEFINE__________________________________________________________*/
    #define OPTION_SECTION_CCHUNKER                               L"CCHUNKER"
     
    #define OPTION_KEYNAME_VERB_FRENCH                            L"VERB_FRENCH"
    #define OPTION_KEYNAME_NOUN_FRENCH                            L"NOUN_FRENCH"
    #define OPTION_KEYNAME_PRESTOPPER_FRENCH                      L"PRESTOPPER_FRENCH"
    #define OPTION_KEYNAME_POSTSTOPPER_FRENCH                     L"POSTSTOPPER_FRENCH"
    #define OPTION_KEYNAME_FUNCT_FRENCH                           L"FUNCT_FRENCH"
    #define OPTION_KEYNAME_LEMMA_NON_STOPPER_FRENCH               L"LEMMA_NON_STOPPER_FRENCH"
     
     
    #define OPTION_KEYNAME_VERB_ENGLISH                           L"VERB_ENGLISH"
    #define OPTION_KEYNAME_NOUN_ENGLISH                           L"NOUN_ENGLISH"
    #define OPTION_KEYNAME_PRESTOPPER_ENGLISH                     L"PRESTOPPER_ENGLISH"
    #define OPTION_KEYNAME_POSTSTOPPER_ENGLISH                    L"POSTSTOPPER_ENGLISH"
    #define OPTION_KEYNAME_FUNCT_ENGLISH                          L"FUNCT_ENGLISH"
    #define OPTION_KEYNAME_LEMMA_STOPPER_ENGLISH                  L"LEMMA_STOPPER_ENGLISH"
     
     
    #define OPTION_KEYNAME_VERB_SPANISH                           L"VERB_SPANISH"
    #define OPTION_KEYNAME_NOUN_SPANISH                           L"NOUN_SPANISH"
    #define OPTION_KEYNAME_PRESTOPPER_SPANISH                     L"PRESTOPPER_SPANISH"
    #define OPTION_KEYNAME_POSTSTOPPER_SPANISH                    L"POSTSTOPPER_SPANISH"
    #define OPTION_KEYNAME_FUNCT_SPANISH                          L"FUNCT_SPANISH"
    #define OPTION_KEYNAME_LEMMA_NON_STOPPER_SPANISH              L"LEMMA_NON_STOPPER_SPANISH"
     
     
    #define OPTION_KEYNAME_VERB_ITALIAN                           L"VERB_ITALIAN"
    #define OPTION_KEYNAME_NOUN_ITALIAN                           L"NOUN_ITALIAN"
    #define OPTION_KEYNAME_PRESTOPPER_ITALIAN                     L"PRESTOPPER_ITALIAN"
    #define OPTION_KEYNAME_POSTSTOPPER_ITALIAN                    L"POSTSTOPPER_ITALIAN"
    #define OPTION_KEYNAME_FUNCT_ITALIAN                          L"FUNCT_ITALIAN"
    #define OPTION_KEYNAME_LEMMA_NON_STOPPER_ITALIAN              L"LEMMA_NON_STOPPER_ITALIAN"
     
     
    #define OPTION_KEYNAME_VERB_GERMAN                            L"VERB_GERMAN"
    #define OPTION_KEYNAME_NOUN_GERMAN                            L"NOUN_GERMAN"
    #define OPTION_KEYNAME_PRESTOPPER_GERMAN                      L"PRESTOPPER_GERMAN"
    #define OPTION_KEYNAME_POSTSTOPPER_GERMAN                     L"POSTSTOPPER_GERMAN"
    #define OPTION_KEYNAME_FUNCT_GERMAN                           L"FUNCT_GERMAN"
    #define OPTION_KEYNAME_LEMMA_NON_STOPPER_GERMAN               L"LEMMA_NON_STOPPER_GERMAN"
     
    /*_____GLOBAL-TYPES___________________________________________________________*/
    /*_____GLOBAL-DATA____________________________________________________________*/
    /*_____GLOBAL-MACROS__________________________________________________________*/
    /*_____GLOBAL-FUNCTIONS-PROTOTYPES____________________________________________*/
    namespace SpecificationLoader
    {
        using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
    	using namespace System::IO;
    /*_____CLASS-DEFINITION_______________________________________________________*/
    	class CChunker
    	{
    	private:
    		std::list<enPOS> m_ListPosVerb;                 //Pos List for verb chunk type
    		std::list<enPOS> m_ListPosNoun;                 //Pos List for noun chunk type
    		std::list<enPOS> m_ListPostStopper;             //Pos List for poststopper chunk type
    		std::list<enPOS> m_ListPreStopper;              //Pos List for prestopper chunk type
    		std::list<enPOS> m_ListPosFunct;                //Pos List for function chunk type
    		std::list<std::wstring> m_wsListLemmaNonStopper;//Lemma Stopper list
    		enum enCChunkerMethod
    		{
    			SPLIT_INTO_CHUNK =1,
    		};
    		public:
    			CChunker();
    			~CChunker();
    			static enPOS TestPosType(CAnalysedWord *pWord);
    			static erc SplitIntoChunk(CAnalysedSegment *pSegment, std::wstring id);
    			//                                                                         1                                                        2                       3                   4            5                6                  7                                                   8
    			static CAnalysedChunk* AnalyseCurrentVerbSyntagme( CLinguisticSegment * pLinguisticSegment, std::list<CAnalysedWord*>::iterator& itWord, CAnalysedChunk *pCurrentChunk, int& Step, enPOS& DrivingPos, bool bMarkOngoing, bool bPivotPending, std::list<CAnalysedWord*>::iterator& itEndWord);
    			static CAnalysedChunk* AnalyseCurrentNounSyntagme( CLinguisticSegment * pLinguisticSegment, std::list<CAnalysedWord*>::iterator& itWord, CAnalysedChunk* pCurrentChunk, int & Step, enPOS & DrivingPos, bool bMarkOngoing, bool bPivotPending);
    			static CAnalysedChunk* InitiateCurrentNounSyntagme( CLinguisticSegment * pLinguisticSegment, std::list<CAnalysedWord*>::iterator& itWord, CAnalysedChunk * pCurrentChunk, int& Step, enPOS& DrivingPos, bool bMarkOngoing, bool bPivotPending);
    			static CAnalysedChunk* InitiateCurrentVerbSyntagme( CLinguisticSegment * pLinguisticSegment, std::list<CAnalysedWord*>::iterator& itWord, CAnalysedChunk* pCurrentChunk, int& Step, enPOS& DrivingPos, bool bMarkOngoing, bool bPivotPending);
    			static bool IsSameChunkType(enChunkType TypeOfPreviousWord, CAnalysedWord *pWord);
    			static enChunkType NewPosType(CAnalysedWord *pWord, CAnalysedWord *pNextWord);
    			static CAnalysedWord* SetMark(std::wstring wsMark, enPOS POS, int len);
    			void CaseNoun( enPOS Curpos, CAnalysedChunk* pCurrentChunk, CAnalysedWord* pWord, int &Step, enPOS &DivingPos);
    	};// end of class
    	extern bool m_bOptionProblem;                   //To know if Option Mananger have done his work or not
    }; // end of namespace
    #endif /* CHUNKER_H */
    et les erreurs qui pointent sur les m_ListPosXXXX
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(347): error C2228: la partie gauche de '.begin' doit avoir un class/struct/union
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(347): error C2228: la partie gauche de '.end' doit avoir un class/struct/union
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(348): error C2228: la partie gauche de '.end' doit avoir un class/struct/union
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(354): error C2228: la partie gauche de '.begin' doit avoir un class/struct/union
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(354): error C2228: la partie gauche de '.end' doit avoir un class/struct/union
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(355): error C2228: la partie gauche de '.end' doit avoir un class/struct/union
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(361): error C2228: la partie gauche de '.begin' doit avoir un class/struct/union
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(361): error C2228: la partie gauche de '.end' doit avoir un class/struct/union
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(362): error C2228: la partie gauche de '.end' doit avoir un class/struct/union
    qui m'aidera sera

  2. #2
    Expert confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 487
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 487
    Par défaut
    J'ai maintenant un problème de compilation dans un code qui plante à l’exécution:
    Vous êtes balèze, vous arrivez à avoir des plantages à l'exécution d'un truc qui compile pas.

    Bon on va dire que ça compile pas, vu que c'est des erreurs de compilation.

    On va commencer par donner un coup de main au compilateur en spécifiant le paramètre template de std::find.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    std::find<enPOS>( m_ListPosNoun.begin(), m_ListPosNoun.end(), pWord->POS);
    Cela donnera peut-être un message plus explicite.

    Et connaissant le gugusse, je préconise l'utilisation de compilation "/P" pour vérifier l’utilisation de MACRO bien pourries.
    Jean-Noël, pas besoin de te réexpliquer comment t'en servir pour la n-ième fois ?

  3. #3
    Membre extrêmement actif
    Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2008
    Messages
    1 022
    Détails du profil
    Informations personnelles :
    Localisation : France, Mayenne (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Décembre 2008
    Messages : 1 022
    Par défaut et si!
    J'ai pris ta modification
    ça n'a pas changé les messages d'erreur
    et je suis obligé de te demandé à nouveau la procédure pour passe l'option /P
    la dernière fois que tu l'as demandé, je n'ai pas réussi.

  4. #4
    Membre extrêmement actif
    Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2008
    Messages
    1 022
    Détails du profil
    Informations personnelles :
    Localisation : France, Mayenne (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Décembre 2008
    Messages : 1 022
    Par défaut Les variables sont des pointeurs
    J'ai mis a jour les variables en choisissant des pointeurs
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    		std::list<enPOS>* ptListPosVerb;                 //Pos List for verb chunk type
    		std::list<enPOS>* ptListPosNoun;                 //Pos List for noun chunk type
    		std::list<enPOS>* ptListPosPostStopper;             //Pos List for poststopper chunk type
    		std::list<enPOS>* ptListPosPreStopper;              //Pos List for prestopper chunk type
    		std::list<enPOS>* ptListPosFunct;                //Pos List for function chunk type
    ça n'a changé les messages d'erreurs qu'à la marge:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(348): error C2227: la partie gauche de '->begin' doit pointer vers un type class/struct/union/générique
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(348): error C2227: la partie gauche de '->end' doit pointer vers un type class/struct/union/générique
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(349): error C2227: la partie gauche de '->end' doit pointer vers un type class/struct/union/générique
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(355): error C2227: la partie gauche de '->begin' doit pointer vers un type class/struct/union/générique
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(355): error C2227: la partie gauche de '->end' doit pointer vers un type class/struct/union/générique
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(356): error C2227: la partie gauche de '->end' doit pointer vers un type class/struct/union/générique
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(362): error C2227: la partie gauche de '->begin' doit pointer vers un type class/struct/union/générique
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(362): error C2227: la partie gauche de '->end' doit pointer vers un type class/struct/union/générique
    1>..\..\..\..\Linguistic\Analyser\src\chunker.cpp(363): error C2227: la partie gauche de '->end' doit pointer vers un type class/struct/union/générique
    .

  5. #5
    Membre extrêmement actif
    Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2008
    Messages
    1 022
    Détails du profil
    Informations personnelles :
    Localisation : France, Mayenne (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Décembre 2008
    Messages : 1 022
    Par défaut J'ai essayé de les caster
    J'ai essayé de les caster, mais ça n'a rien changé, à croire que std::list<enPOS>* n'est pas un type class/struct/union/générique
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
        itPosNoun = std::find<enPOS>( (std::list<enPOS>*)ptListPosNoun->begin(), (std::list<enPOS>*)ptListPosNoun->end(), pWord->POS);
        if(itPosNoun != (std::list<enPOS>*)ptListPosNoun->end())
    Moi je crois que std:list est une structure générique

  6. #6
    Expert confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 487
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 487
    Par défaut
    Soyez pas radin avec les parenthèses !
    http://fr.cppreference.com/w/cpp/lan...tor_precedence
    Votre cast, sans les parenthèses, il sert à rien.
    et je suis obligé de te demandé à nouveau la procédure pour passe l'option /P
    Google est ton ami, même pour retrouver tes messages.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 6
    Dernier message: 11/07/2013, 12h04
  2. Réponses: 2
    Dernier message: 16/03/2009, 11h07
  3. Impossible d'appeler un autre constructeur
    Par Topeur dans le forum C++
    Réponses: 3
    Dernier message: 27/05/2008, 18h44
  4. Réponses: 5
    Dernier message: 27/05/2008, 14h08
  5. begin et end dans mysql
    Par acipeg dans le forum Outils
    Réponses: 4
    Dernier message: 14/12/2006, 09h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo