Meilleur auteur de réponses
trouver le pourquoi d'un message d'erreur

Question
-
Bonjour,
Je suis en train de migrer le projet qui était en mode natif pour le passer en mode managé
J'ai des messages d'erreur incompréhensible je vous met le premier et mes réflexions
1>D:\usr\Specification Loader\dev\Linguistic\ParserManager\com\ParserManager.h(44): error C2065: 'CAnalysedWordM' : identificateur non déclaré
or la liste d'include comporte les includes suivants:
#include "StdAfx.h" #include "AlignStructure.h" #include "Macro.h" #include "EnumerationM.hpp" #include "StructureM.h" #include "TypeDefsM.hpp" #include "POSM.h" #include "Layout.h" #include "ClasseAlignerManaged.hpp" #include "LinkDescription.h" #include "Message.h" #include "Event.h" #include "StrConv.h" #include "Synsets.h" #include "Dictionnaire.h" #include "StrToken.h" #include "MorphSynset.hpp" #include "ParserManager.h" #include "BrillType.h"
et dans ClasseAlignerManaged je trouve:
public ref class CAnalysedWordM { public: unsigned long long ullWordID; // Identifiant du Word dans la base de données unsigned long long ullLemmaID; // Identifiant du Lemma dans la base de données System::String^ wsWord; // Texte du mot System::String^ wsLemma; // Texte du lemma enPOSM POS; // Part Of Speech du lemma (et du mot) enGenderM iGender; // Genre du lemma (et du mot) enPersM iPers; // la Personne du mot enNbrM iNbr; // le nombre du mot System::String^ wsPronunciation; // Prononciation du lemma (pour le japonais) int iExcluded; // La valeur du lemma est important ou non int ValueOfWord; // la valeur du mot pour l'alignement unsigned long ulStart; // Position du premier caractère du mot dans le segment unsigned long ulLength; // Longueur du mot (les espaces sont exclus) int iWordOccurence; // occurence du mot dans la BD CAnalysedWordM() { } ~CAnalysedWordM() {;} };
Allors je ne comprend pas le message d'erreur. Qui pourra m'orienter?
Jean Noël Martin
Réponses
-
Révisez les mécanismes des includes (bis).
C'est un bordel monstre, vos includes.
CAnalysedWordM n'est pas déclaré, c'est "SpecificationChecker::CAnalysedWordM" qui est déclaré.
Les classes du namespace SpecificationChecker ne sont pas automatiquement connues des classes du namespace SpecificationLoader.
Paul Bacelar, Ex - MVP VC++
- Marqué comme réponse JeanNoel53 jeudi 1 janvier 2015 20:57
Toutes les réponses
-
-
/******************************************************************************* * NOM: * ROLE: * HISTORIQUE: * 05/05/2001, xxx, initial version *******************************************************************************/ #ifndef PARSERMANAGER_H #define PARSERMANAGER_H /*_____INCLUDE-FILES__________________________________________________________*/ /*_____GLOBAL-DEFINE__________________________________________________________*/ #define LEMMA_TRANSLATION_NUMBER 100 #define LEMMA_SIZE 256 #define WORD_NUMBER_OF_A_BLOC 5000 /*_____GLOBAL-TYPES___________________________________________________________*/ /*_____GLOBAL-MACROS__________________________________________________________*/ /*_____GLOBAL-FUNCTIONS-PROTOTYPES____________________________________________*/ /*_____CLASS-DEFINITION_______________________________________________________*/ 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 CParserManager { private : enum { PARSE_BLOC = 1, GET_TRANSLATIONS_OF_SOURCE_LEMMA }; enLanguageM m_Language; void *m_pXeldaManager; public : CParserManager::CParserManager(); CParserManager::~CParserManager(); erc CParserManager::Brill_ParseBloc( wchar_t * pBlocText, stAnalysedWordM^ pListAnalysedWord, unsigned long* ulWordNumber, long iPos); erc CParserManager::ParserAnalyse( stAnalysedWordM^ pListAnalysedWord, std::list<CAnalysedWordM^>^ pListWord, unsigned long ulWordNumber); erc CParserManager::InitParserManager(enLanguageM Language); erc CParserManager::GetTranslationsOfSourceLemma( System::String^ wsSourceLemma, enLanguageM SourceLanguage, enLanguageM TargetLanguage, List<CAnalysedWordM^>^ ListLemmaTranslation); void CParserManager::QualifPivot( stAnalysedWordM^ pListAnalysedWord, int ulWordNumber); int CParserManager::BTranscodePartOfSpeech( char* NextStr, char* str, char* wd, char* pPOS, char* pFlex, enStatusM* iStatus); erc CParserManager::ParseBloc( System::String^ wsBloc, List<CAnalysedWordM^>^ pListWord); char* CParserManager::strtolower( char *str); }; }; #endif /* PARSERMANAGER_H */
Jean Noël Martin
-
Révisez les mécanismes des includes.
Je ne sais pas pourquoi le type "stAnalysedWordM" ligne 43 ne pose pas de problème, mais ligne 44 le type "CAnalysedWordM" n'est pas déclaré.
Tout type utilisé doit être déclaré avant utilisation.
Les includes et les déclarations anticipées sont là pour ça.
Paul Bacelar, Ex - MVP VC++
-
je vous met les déclarations dans les fichiers ci-dessous
/******************************************************************************* * FILE NAME: ClasseAlignerManaged.hpp * PURPOSE: This file contains constants and user defined data for all the * classes. * HISTORY: * Date Version Author * 16/05/2003 initial version :1.0 jn Martin *******************************************************************************/ #ifndef ClassesManagedH #define ClassesManagedH //--------------------------- INCLUDE-FILES ------------------------------------ //--------------------------- CLASS-DEFINITION --------------------------------- namespace SpecificationChecker { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Collections::Generic; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace System::IO; public ref struct stUniversM { int idParagraph; System::String^ wsName; }; public ref class CLayoutM { public: bool bTitle; CLayoutM::CLayoutM() {;}; CLayoutM::~CLayoutM() {;}; }; ref class CElementM { public: System::String^ wsElementText; CLayoutM^ pLayout; CElementM::CElementM() { ; } CElementM::~CElementM() { ; } }; ref class CBlocM { public: System::String^ wsBlocText; CLayoutM^ pLayoutBloc; List<CElementM^>^ plistElement; CBlocM::CBlocM() { ; } CBlocM::~CBlocM() { ; } }; public ref class CAnalysedWordM { public: unsigned long long ullWordID; // Identifiant du Word dans la base de données unsigned long long ullLemmaID; // Identifiant du Lemma dans la base de données System::String^ wsWord; // Texte du mot System::String^ wsLemma; // Texte du lemma enPOSM POS; // Part Of Speech du lemma (et du mot) enGenderM iGender; // Genre du lemma (et du mot) enPersM iPers; // la Personne du mot enNbrM iNbr; // le nombre du mot System::String^ wsPronunciation; // Prononciation du lemma (pour le japonais) int iExcluded; // La valeur du lemma est important ou non int ValueOfWord; // la valeur du mot pour l'alignement unsigned long ulStart; // Position du premier caractère du mot dans le segment unsigned long ulLength; // Longueur du mot (les espaces sont exclus) int iWordOccurence; // occurence du mot dans la BD CAnalysedWordM() { } ~CAnalysedWordM() {;} }; public ref class CAnalysedChunkM { public: unsigned long long ullChunkID; // Identifiant du Chunk dans la base de données List<CAnalysedWordM^>^ pListWord; // Liste de pointeurs sur les mots qui constituent le Chunk enChunkTypeM ChunkType; // Type du chunk enFonctionM TypeFonction; enPOSM DrivingPos; // POS du terme qui à conduit à la catégrisation du syntagme CAnalysedChunkM() { ChunkType = enChunkTypeM::CHUNKTYPE_NONE; } ~CAnalysedChunkM() {;} }; public ref class CChunkDescriptionM { public: enChunkTypeM ChunkType; // Type of the Chunk hidDB hidElementID; // Identifier of the segment where the chunk is used long long llChunkID; // Identifiant du Chunk dans la base de données long lInitialPosition; System::String^ wsText; // Texte de l'element int Status; CChunkDescriptionM() {;} ~CChunkDescriptionM() {;} }; public ref class CSegmentChunkDescriptionM { public: hidDB hidElementID; // Identifier of the segment where the chunk is used long long llChunkID; // Identifiant du Chunk dans la base de données long lInitialPosition; System::String^ wsText; // Texte de l'element enChunkTypeM ChunkType; // Type of the Chunk int Status; CSegmentChunkDescriptionM() {;} ~CSegmentChunkDescriptionM() {;} }; public ref class CSegmentStatisticsM { public: hidDB hidSegmentID; // Segment identifier in the database long lCharNumber; // Number of CHAR of this segment long lWordNumber; // Number of WORD of this segment CSegmentStatisticsM() {;} ~CSegmentStatisticsM() {;} }; public ref class CObjetM { public: CObjetM^ Comprend; System::String^ Name; System::String^ Text; bool Valid; CObjetM^ inherit; List<System::String^> Enumerated; int nValue; int min; int max; int type; int step; }; public ref class QualificateurLinkM { public: System::String^ Identifier; enPOSM iPos; int TypeData; cli::array<Int32,1>^ Values; List<CAnalysedWordM^>^ pColors; int iEnumerated; CObjetM^ oValue; }; public ref class QualificateurNormalizedM { public: int indice; int Occurence; List<QualificateurNormalizedM^>^ plistQualificateur; System::String^ ListParagraph; stUniversM^ pUnivers; System::String^ Verb; System::String^ Sujet; System::String^ Complement; System::String^ Comment; System::String^ Declencheur; System::String^ Identifier; bool bIsEnumerated; int iEnumerated; enPOSM iPOS; enPersM iPers; enNbrM iNbr; int TypeData; cli::array<Int32,1>^ Values; int min; int max; int type; List<CAnalysedWordM^>^ pColors; List<CAnalysedWordM^>^ pWord; QualificateurLinkM^ plink; }; public ref class PropositionNormalizedM { public: int TypeProposition; int indice; int Occurence; int iEnumerated; enPOSM iPOS; enPersM iPers; enNbrM iNbr; int TypeData; cli::array<Int32,1>^ Values; int min; int max; int type; bool bIsEnumerated; bool bAllocated; bool bStatus; System::String^ ValWords; System::String^ ListParagraph; stUniversM^ pUnivers; System::String^ Declencheur; System::String^ Configuration; System::String^ Identifier; System::String^ Sujet; System::String^ Verb; System::String^ Complement; System::String^ Precision; System::String^ Frequence; System::String^ Comment; System::String^ wskeyValue; System::String^ operande; List<QualificateurLinkM^>^ plistLink; List<CAnalysedWordM^>^ pColors; List<CAnalysedWordM^>^ pWord; }; public ref class TempPreconditionM { public: int occurence; PropositionNormalizedM^ pPrecondition; }; public ref class TermeM { public: TermeM^ Implique; System::String^ wsOrigine; System::String^ wsTerme; System::String^ wsDeclencheur; System::String^ wsIdentifier; System::String^ wsValueOfWords; System::String^ ListParagraph; System::String^ wskeyValue; System::String^ operande; System::String^ wsText; List<CAnalysedWordM^>^ pWord; bool bStatus; }; public ref class ElementLinksM { public: int linksId; int linksSrc; int idParagraph; }; public ref class ElementSemanticM { public: stUniversM^ pUnivers; System::String^ wsText; System::String^ wsIdentifier; int siIdOccurence; int nuIdTypeElement; int siNbChunk; int nuIdParagraph; int nuIdChunk; int nuIdElemn; int nuIdChunkType; int siNbWord; int ullLemmaID; enPOSM nuIdDrivingPos; int nuIdWord; System::String^ wsWord; System::String^ wsLemma; System::String^ wsPronunciation; int iValWord; int cExcluded; int iIdDoc; enPOSM iPOS; enGenderM iGender; enPersM iPers; enNbrM iNbr; int iStart; int iLength; int iWordOccurence; int indice; System::String^ Sujet; System::String^ listParagraph; List<ElementLinksM^>^ pLink; }; public ref class SubChainM { public: SubChainM() {;}; System::String^ name; CObjetM^ state; }; public ref class CElementSemantiqueM { public: long idElement; long idSegSrc; int iIdDoc; int idParagraph; stUniversM^ pUnivers; List<CAnalysedChunkM^>^ pListChunk; enElementSemantiqueM TypeElement; }; public ref class CLinguisticSegmentM { public: List<CAnalysedWordM^>^ pListWord; // Liste de pointeurs sur les Mots qui constituent le Segment List<CElementSemantiqueM^>^ pListProposition; // Liste de pointeurs sur les Ngrams qui sont dans le Segment List<CAnalysedChunkM^>^ pListChunk; // Liste de pointeurs sur les Chunks qui sont dans le Segment List<ElementSemanticM^>^ pListPredicat; List<ElementSemanticM^>^ pListPrecondition; List<ElementSemanticM^>^ pListQualificatif; List<ElementSemanticM^>^ pListUnivers; List<QualificateurNormalizedM^>^ plistQualificateurNormalized; List<PropositionNormalizedM^>^ pListPredicatNormalized; List<PropositionNormalizedM^>^ pListPreconditionNormalized; List<CObjetM^>^ plistObjectsNormalized; CLinguisticSegmentM() {;} ~CLinguisticSegmentM() {;} }; public ref class CAnalysedSegmentM { public: unsigned long long ullSegmentID; // Identifiant du Segment dans la base de données CLinguisticSegmentM^ pLinguisticSegment; // Segment decomposition CLayoutM^ pSegmentLayout; // Segment layout at the segment level only short shSegmentCharLength; // Number of character in sentence short shSegmentWordLength; // Number of words in sentence enLanguageM Language; // Langue du segment unsigned long ulDocPosition; // Segment position into the Document CAnalysedSegmentM::CAnalysedSegmentM() { ; }; CAnalysedSegmentM::~CAnalysedSegmentM() { ; }; }; }; #endif
et le fichier structureM
/******************************************************************************* * FILE NAME: StructureM.h * PURPOSE: This file contains constants and user defined data for all the * classes. * HISTORY: * Date Version Author * 16/05/2003 initial version :1.0 JN Martin *******************************************************************************/ #ifndef StructureM_H #define StructureM_H //--------------------------- INCLUDE-FILES ------------------------------------ //-------------------------- GLOBAL-NAMESPACE----------------------------------- //------------------------------------------------------------------------------ ref struct sEquationM { int len; array<System::String^, 1>^ pWord1; array<System::String^, 1>^ pWord2; }; struct Splitt { char* tete; char* queue; }; ref struct ElementWork { int Id; System::String^ wsText; }; ref struct stPOSM { array<enPOSM, 1>^ pPOS; }; ref struct stOptionStructureM { System::String^ sSectionName; System::String^ sKeyName; System::String^ sValue; }; ref struct stAnalysedWordM { array<wchar_t, 1>^ wsWord; // Texte du mot array<wchar_t, 1>^ wsLemma; // Texte du lemma enPOSM POS; // Part Of Speech du lemma (et du mot) enGenderM Gender; // Genre du lemma (et du mot) enPersM iPers; enNbrM iNbr; int iExcluded; // Le lemma est important ou non unsigned long ulStart; // Position du premier caractère du mot dans le segment unsigned long ulLength; // Longueur du mot (les espaces sont exclus) }; ref struct stElementDescriptionM { System::String^ sSectionName; System::String^ sKeyName; System::String^ sValue; unsigned int dwValue; bool bValue; System::String^ sDefaultValue; unsigned int dwDefaultValue; bool bDefaultValue; int iType; }; #endif
vous y trouverez les déclarations de CAnalysedWordM et de stAnalysedWordM.
Jean Noël Martin
-
Révisez les mécanismes des includes (bis).
C'est un bordel monstre, vos includes.
CAnalysedWordM n'est pas déclaré, c'est "SpecificationChecker::CAnalysedWordM" qui est déclaré.
Les classes du namespace SpecificationChecker ne sont pas automatiquement connues des classes du namespace SpecificationLoader.
Paul Bacelar, Ex - MVP VC++
- Marqué comme réponse JeanNoel53 jeudi 1 janvier 2015 20:57