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

MFC Discussion :

Problème pour lier une librairie... (ANTLR)


Sujet :

MFC

  1. #1
    Membre régulier Avatar de loupdeau
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    125
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2005
    Messages : 125
    Points : 79
    Points
    79
    Par défaut Problème pour lier une librairie... (ANTLR)
    Salut,

    j'essaye en vain d'utiliser ANTLR avec Visual C++ 6.
    www.antlr.org

    Pour l'instant j'essaye de compiler l'exemple "calc" mais sans succès.

    Ce que j'ai fait jusqu'à présent :

    Dans Project->Setting->Link->Object/Librairy module j'ai ajouté la librairie : antlr.lib

    Dans Project->Setting->C/C++->Preprocessor->Additional include directories j'ai ajouté : ./.
    Le répertoire antlr contenant les includes nécessaire se trouve dans la racine de mon projet.

    Concernant le fichier "calc.g" contenant le parseur et le lexiqueur, j'ai défini un Custom build qui fonctionne (apparement)


    J'obtient constament ca (+ plein d'autres choses encore):

    LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library

    Est-ce que quelqu'un utilise ANTLR sous Visual C++ 6 ? Si oui comment faire ???

    Merci d'avance !
    Il y a seulement 10 sortes de personnes dans le monde. Ceux qui comprennent le binaire et ceux qui ne le comprennent pas.

  2. #2
    Rédacteur
    Avatar de Laurent Gomila
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2003
    Messages
    10 651
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2003
    Messages : 10 651
    Points : 15 920
    Points
    15 920
    Par défaut
    Salut

    Il serait intéressant de voir les "autres choses", car ça ce n'est qu'un warning et ça ne devrait pas empêcher l'édition de lien de fonctionner.

    Ce warning vient du fait que ta bibliothèque a été compilée avec une autre version de la RTC. Va dans les options (me rappelle plus où exactement dans VC6) et change en "multithreaded dll" ou quelque chose comme ça. Enfin il me semble.

  3. #3
    Membre régulier Avatar de loupdeau
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    125
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2005
    Messages : 125
    Points : 79
    Points
    79
    Par défaut
    Voila les autres choses :

    Linking...
    libcpd.lib(locale.obj) : error LNK2005: "public: static class std::locale::id std::num_put<char,class std::ostreambuf_iterator<char,struct std::char_traits<char> > >::id" (?id@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0
    locale@2@A) already defined in antlr.lib(CharScanner.obj)
    libcpd.lib(locale.obj) : error LNK2005: "public: static class std::locale::id std::numpunct<char>::id" (?id@?$numpunct@D@std@@2V0locale@2@A) already defined in antlr.lib(CharScanner.obj)
    LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
    dtdParser.obj : error LNK2001: unresolved external symbol "public: float __thiscall CalcTreeWalker::expr(class antlr::ASTRefCount<class antlr::AST>)" (?expr@CalcTreeWalker@@QAEMV?$ASTRefCount@VAST@antlr@@@antlr@@@Z)
    dtdParser.obj : error LNK2001: unresolved external symbol "public: __thiscall CalcTreeWalker::CalcTreeWalker(void)" (??0CalcTreeWalker@@QAE@XZ)
    dtdParser.obj : error LNK2001: unresolved external symbol "public: void __thiscall CalcParser::expr(void)" (?expr@CalcParser@@QAEXXZ)
    dtdParser.obj : error LNK2001: unresolved external symbol "public: void __thiscall CalcParser::initializeASTFactory(class antlr::ASTFactory &)" (?initializeASTFactory@CalcParser@@QAEXAAVASTFactory@antlr@@@Z)
    dtdParser.obj : error LNK2001: unresolved external symbol "public: __thiscall CalcParser::CalcParser(class antlr::TokenStream &)" (??0CalcParser@@QAE@AAVTokenStream@antlr@@@Z)
    dtdParser.obj : error LNK2001: unresolved external symbol "public: __thiscall CalcLexer::CalcLexer(class std::basic_istream<char,struct std::char_traits<char> > &)" (??0CalcLexer@@QAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z)
    antlr.lib(String.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(ASTNULLType.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(Token.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(InputBuffer.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(CommonAST.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(BaseAST.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(CommonToken.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(CharBuffer.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(RecognitionException.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(MismatchedTokenException.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(Parser.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(TokenBuffer.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(ASTFactory.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(CharScanner.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(BitSet.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(MismatchedCharException.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    antlr.lib(ASTNULLType.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(Token.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(InputBuffer.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(BaseAST.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(CommonToken.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(CharBuffer.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(String.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(RecognitionException.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(MismatchedTokenException.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(TokenBuffer.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(CommonAST.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(ASTFactory.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(CharScanner.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(BitSet.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(MismatchedCharException.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    antlr.lib(CharScanner.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ)
    antlr.lib(CharBuffer.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ)
    antlr.lib(CharScanner.obj) : error LNK2001: unresolved external symbol "public: __thiscall bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z)
    antlr.lib(CharBuffer.obj) : error LNK2001: unresolved external symbol "public: __thiscall bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z)
    antlr.lib(CharScanner.obj) : error LNK2001: unresolved external symbol "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z)
    antlr.lib(CharBuffer.obj) : error LNK2001: unresolved external symbol "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z)
    antlr.lib(CharScanner.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
    antlr.lib(CharBuffer.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
    antlr.lib(CharScanner.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
    Debug/dtdParser.exe : fatal error LNK1120: 13 unresolved externals
    Error executing link.exe
    et maintenant je retourne à la recherche de l'option " "multithreaded dll" ou quelque chose comme ça"...
    Il y a seulement 10 sortes de personnes dans le monde. Ceux qui comprennent le binaire et ceux qui ne le comprennent pas.

  4. #4
    Rédacteur
    Avatar de Laurent Gomila
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2003
    Messages
    10 651
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2003
    Messages : 10 651
    Points : 15 920
    Points
    15 920
    Par défaut
    S'il ne résoud aucun lien alors que tu as lié avec la bibliothèque, ça ne sent pas très bon. Tu es sûr que la version que tu as téléchargée est bien pour VC++ 6 et pas pour un autre compilo ?

  5. #5
    Membre régulier Avatar de loupdeau
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    125
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2005
    Messages : 125
    Points : 79
    Points
    79
    Par défaut
    Je sais pas j'utilise le fichier antlr.lib et les includes fournis...



    J'ai trouvé un lien de quelqu'un qui a utilisé ANTLR avec Visual C++ 6
    http://www.imada.sdu.dk/~morling/issue1.htm

    je fais exactement ce qu'il dit. mais comme d'hab j'ai la poisse et ca fonctionne pas

    la technique consiste à ajouter une libraire statique à mon workspace. je met les source d'antlr dedans. et ensuite il suffit normalement de compiler sauf que j'obtient les erreurs suivantes :

    fatal error C1189: #error : "DLL Build not supported on old MSVC's"
    concernant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    #if defined( _MSC_VER ) && ( _MSC_VER < 1300 )
    # error "DLL Build not supported on old MSVC's"
    // Ok it seems to be possible with STLPort in stead of the vanilla MSVC STL
    // implementation. This needs some work though. (and don't try it if you're
    // not that familiar with compilers/building C++ DLL's in windows)
    #endif
    et encore quelque autres qui dépende peut-etre de celle ci...

    Il y a seulement 10 sortes de personnes dans le monde. Ceux qui comprennent le binaire et ceux qui ne le comprennent pas.

Discussions similaires

  1. [Visual C++ 2010] Problème pour linker une librairie
    Par CleeM dans le forum Visual C++
    Réponses: 9
    Dernier message: 30/08/2012, 16h22
  2. Problème pour lier des extensions à une application
    Par blandinais dans le forum Windows 7
    Réponses: 4
    Dernier message: 27/12/2011, 11h51
  3. Réponses: 1
    Dernier message: 20/12/2010, 22h43
  4. Problème pour lier un valeur saisie avec une requête.
    Par jejeapollo dans le forum Requêtes et SQL.
    Réponses: 2
    Dernier message: 10/08/2007, 12h56
  5. [ANTLR/EXPRESS] Problèmes pour créer une grammaire de EXPRESS
    Par cotmar dans le forum Autres langages
    Réponses: 2
    Dernier message: 07/05/2007, 09h05

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