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 :

Erreurs LNK2020 et LNK2028


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 Erreurs LNK2020 et LNK2028
    bonjour
    J'ai un unresolved qui résiste
    je vous met la déclaration:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    public:
    		CStrConv::CStrConv();
    		CStrConv::~CStrConv();
    		static erc CStrConv::CreateReturnCode( int iType, int iMessageCode, int iModuleId, int iClassId, int iFunctionId, int iReturnFunction);
    et le linker se fâche :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    1>MainMenue.obj : error LNK2020: jeton non résolu (0A0000A3) "public: static unsigned __int64 __cdecl SpecificationLoader::CStrConv::CreateReturnCode(int,int,int,int,int,int)" (?CreateReturnCode@CStrConv@SpecificationLoader@@$$FSA_KHHHHHH@Z)
    1>Option.obj : error LNK2028: jeton non résolu (0A000170) "public: static unsigned __int64 __cdecl SpecificationLoader::CStrConv::CreateReturnCode(int,int,int,int,int,int)" (?CreateReturnCode@CStrConv@SpecificationLoader@@$$FSA_KHHHHHH@Z) référencé dans la fonction "public: static unsigned __int64 __cdecl SpecificationLoader::COption::SaveOptions(void)" (?SaveOptions@COption@SpecificationLoader@@$$FSA_KXZ)
    1>WordManager.obj : error LNK2028: jeton non résolu (0A000132) "public: static unsigned __int64 __cdecl SpecificationLoader::CStrConv::CreateReturnCode(int,int,int,int,int,int)" (?CreateReturnCode@CStrConv@SpecificationLoader@@$$FSA_KHHHHHH@Z) référencé dans la fonction "public: unsigned __int64 __clrcall SpecificationLoader::CWManager::OpenWordDocument(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?OpenWordDocument@CWManager@SpecificationLoader@@$$FQ$AAM_KV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)
    1>ParserManager.obj : error LNK2028: jeton non résolu (0A0000B7) "public: static unsigned __int64 __cdecl SpecificationLoader::CStrConv::CreateReturnCode(int,int,int,int,int,int)" (?CreateReturnCode@CStrConv@SpecificationLoader@@$$FSA_KHHHHHH@Z) référencé dans la fonction "public: unsigned __int64 __thiscall SpecificationLoader::CParserManager::ParseBloc(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class std::list<class SpecificationLoader::CAnalysedWord *,class std::allocator<class SpecificationLoader::CAnalysedWord *> > *)" (?ParseBloc@CParserManager@SpecificationLoader@@$$FQAE_KV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PAV?$list@PAVCAnalysedWord@SpecificationLoader@@V?$allocator@PAVCAnalysedWord@SpecificationLoader@@@std@@@4@@Z)
    1>segmentation.obj : error LNK2028: jeton non résolu (0A00017E) "public: static unsigned __int64 __cdecl SpecificationLoader::CStrConv::CreateReturnCode(int,int,int,int,int,int)" (?CreateReturnCode@CStrConv@SpecificationLoader@@$$FSA_KHHHHHH@Z) référencé dans la fonction "public: unsigned __int64 __thiscall SpecificationLoader::CSegmentation::SplitIntoSegment(enum enLanguage,class std::list<class SpecificationLoader::CAnalysedWord *,class std::allocator<class SpecificationLoader::CAnalysedWord *> >,class std::list<class SpecificationLoader::CAnalysedSegment *,class std::allocator<class SpecificationLoader::CAnalysedSegment *> > *)" (?SplitIntoSegment@CSegmentation@SpecificationLoader@@$$FQAE_KW4enLanguage@@V?$list@PAVCAnalysedWord@SpecificationLoader@@V?$allocator@PAVCAnalysedWord@SpecificationLoader@@@std@@@std@@PAV?$list@PAVCAnalysedSegment@SpecificationLoader@@V?$allocator@PAVCAnalysedSegment@SpecificationLoader@@@std@@@5@@Z)
    1>schedulerGlobal.obj : error LNK2028: jeton non résolu (0A0001E4) "public: static unsigned __int64 __cdecl SpecificationLoader::CStrConv::CreateReturnCode(int,int,int,int,int,int)" (?CreateReturnCode@CStrConv@SpecificationLoader@@$$FSA_KHHHHHH@Z) référencé dans la fonction "public: unsigned __int64 __thiscall SpecificationLoader::CSchedulerGlobal::AnalyseSegment(class std::_List_iterator<class std::_List_val<class SpecificationLoader::CAnalysedChunk *,class std::allocator<class SpecificationLoader::CAnalysedChunk *> > >,class std::_List_iterator<class std::_List_val<class SpecificationLoader::CAnalysedWord *,class std::allocator<class SpecificationLoader::CAnalysedWord *> > >,class SpecificationLoader::CAnalysedSegment *,class SpecificationLoader::CAnalysedChunk *,bool,bool &,bool &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class SpecificationLoader::CMDBManager *,unsigned __int64,bool *,int,int,class std::basic_string<wchar_t,struct std::char_traits<wch
    J'ai du louper quelque chose : celui qui m'aidera sera

  2. #2
    Expert confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 468
    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 468
    Par défaut
    Vous êtes bien gentil en nous montrant la déclaration du bidule, mais nous, on n'est comme le linker, on veut la définition de votre machin.

    P.S.: Sujet de file de message toujours aussi merdique.

  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 Je réponds
    je vous met 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
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    erc CStrConv::CreateReturnCode( int iType, int iMessageCode, int iModuleId, int iClassId, int iFunctionId, int iReturnFunction)
    {
       erc dwRetCode;
       erc dwTempCode;
      //Assign the Return function to the return code variable
      dwRetCode = iReturnFunction;
      //Assign the Function Id to the dwTempCode variable
      dwTempCode = iFunctionId;
      //Move the tempCode by 7 bits to the left
      dwTempCode = dwTempCode << MOVE_FOR_FUNCTION_ID;
      //OR the return function and the Function ID
      dwRetCode = dwTempCode | dwRetCode;
     
      //Assign the Class ID variable to dwTempCode
      dwTempCode = iClassId;
      //Move the tempCode by 19 bits to the left
      dwTempCode = dwTempCode << MOVE_FOR_CLASS_ID;
      //OR the return code and the class ID
      dwRetCode = dwTempCode | dwRetCode;
     
      //Assign the Module ID variable to dwTempCode
      dwTempCode = iModuleId;
      //Move the tempCode by 31 bits to the left
      dwTempCode = dwTempCode << MOVE_FOR_MODULE_ID;
      //OR the return code and the Module ID
      dwRetCode = dwTempCode | dwRetCode;
     
      //Assign the Message Code variable to dwTempCode
      dwTempCode = iMessageCode;
      //Move the tempCode by 43 bits to the left
      dwTempCode = dwTempCode << MOVE_FOR_MESSAGE_CODE;
      //OR the return code and the Module ID
      dwRetCode = dwTempCode | dwRetCode;
      //Assign the Type variable to dwTempCode
      dwTempCode = iType;
      //Move the tempCode by 62 bits to the left
      dwTempCode = dwTempCode << MOVE_FOR_TYPE;
      //OR the return code and the Module ID
      dwRetCode = dwTempCode | dwRetCode;
      return( dwRetCode);
    } // End of CreateReturnCode

  4. #4
    Expert éminent
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 394
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 394
    Par défaut
    Pourquoi précises-tu le nom de la classe dans les déclarations de fonction dans la définition de la classe elle-même? On n'est pas censé faire ça normalement...

    En clair, tu devrais faire ceci:
    Code C++ : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    class CStrConv
    {
    public:
    	CStrConv();
    	~CStrConv();
    	static erc CreateReturnCode( int iType, int iMessageCode, int iModuleId, int iClassId, int iFunctionId, int iReturnFunction);
    Au lieu de ceci:
    Code C++? : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    class CStrConv
    {
    public:
    	CStrConv::CStrConv();
    	CStrConv::~CStrConv();
    	static erc CStrConv::CreateReturnCode( int iType, int iMessageCode, int iModuleId, int iClassId, int iFunctionId, int iReturnFunction);

    PS: J'espère que SpecificationLoader est bien un namespace, parce que si c'est une classe, tu t'aventures ici en territoire bizarre en définissant ta fonction erc CStrConv::CreateReturnCode(...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  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 La solution
    il fallait surtout le déclarer en static

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

Discussions similaires

  1. Erreur lnk2028: unresolved token
    Par yves042 dans le forum C++
    Réponses: 3
    Dernier message: 04/05/2010, 02h46
  2. C++ Interop (/CLR) - Erreur LNK2028
    Par zeiht dans le forum C++/CLI
    Réponses: 1
    Dernier message: 27/06/2007, 15h56
  3. Réponses: 2
    Dernier message: 27/05/2002, 19h46
  4. erreur IDL:omg.org/CORBA/MARSHAL:1.0
    Par Pinggui dans le forum CORBA
    Réponses: 3
    Dernier message: 13/05/2002, 15h05
  5. [Kylix] Erreur objet
    Par Anonymous dans le forum EDI
    Réponses: 1
    Dernier message: 22/03/2002, 09h41

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