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

XML Discussion :

lien de librairies libxml


Sujet :

XML

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    27
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2004
    Messages : 27
    Points : 22
    Points
    22
    Par défaut lien de librairies libxml
    salut tout le monde

    j'ai un petit souci avec l'utilisation de libxml

    * en fait je viens de l'installer dans un répertoire personnel :
    /Desktop/Projets/libxml

    donc les .h de libxml sont dans :
    /Desktop/Projets/libxml/include/libxml2/libxml

    * j'ai mis à jours les variables $LDFLAGS et $CPPFLAGS


    * mon fichier de code "test.c" est dans /Desktop

    * mon code est (juste pour tester si ça marche) :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    #include<stdlib.h>
    #include<stdio.h>
    #include<string.h>
     
    #include"libxml/parser.h"
    #include"libxml/tree.h"
     
    int main(int argc, char *argv[])
    {
    printf("bonjour !\n");
    return 0;
    }


    * mais quand je compile : gcc -o test test.c
    j'ai les messages suivants :


    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
    100
    101
    102
    103
    104
    105
    106
    107
    108
     
     
    In file included from test.c:5:
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:15:31: error: libxml/xmlversion.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:16:25: error: libxml/tree.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:17:25: error: libxml/dict.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:18:25: error: libxml/hash.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:19:26: error: libxml/valid.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:20:29: error: libxml/entities.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:21:29: error: libxml/xmlerror.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:22:30: error: libxml/xmlstring.h: Aucun fichier ou répertoire de ce type
    In file included from test.c:5:
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:52: error: expected ‘)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:56: error: expected specifier-qualifier-list before ‘xmlParserInputBufferPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:187: error: expected specifier-qualifier-list before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:308: error: expected ‘:’, ‘,’, ‘;’, ‘}or ‘__attribute__’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:336: error: expected declaration specifiers or ‘...’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:337: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:349: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:362: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:374: error: expected declaration specifiers or ‘...’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:375: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:385: error: expected declaration specifiers or ‘...’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:386: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:399: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:414: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:430: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:446: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:460: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:473: error: expected declaration specifiers or ‘...’ before ‘xmlSAXLocatorPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:497: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:507: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:520: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:530: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:540: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:552: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:563: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:573: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:584: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:594: error: expected ‘)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:604: error: expected ‘)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:616: error: expected ‘)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:679: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:700: error: expected ‘;’, ‘,’ or)’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:706: error: expected specifier-qualifier-list before ‘internalSubsetSAXFunc’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:747: error: expected specifier-qualifier-list before ‘internalSubsetSAXFunc’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:788: error: expected declaration specifiers or ‘...’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:790: error: expected declaration specifiers or ‘...’ before ‘xmlParserCtxtPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:790: error: ‘xmlParserInputPtr’ declared as function returning a function
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:796:29: error: libxml/encoding.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:797:26: error: libxml/xmlIO.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:798:28: error: libxml/globals.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:808: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:810: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:816: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:819: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:835: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:837: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:839: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:841: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:843: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:862: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:864: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:929: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlParserErrors’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:953: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:962: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlParserCtxtPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:964: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:966: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:968: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:976: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlParserCtxtPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1017: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlParserCtxtPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1025: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlParserInputPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1033: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘const’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1036: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1038: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1040: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘unsigned’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1043: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1051: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1053: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlExternalEntityLoader’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1055: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlParserInputPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1063: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘long’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1097: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘void’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1099: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1105: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1108: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1113: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1117: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1123: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1128: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1135: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1141: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1146: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1153: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1159: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘xmlDocPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:1213: error: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    In file included from test.c:6:
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:35: error: conflicting types for ‘xmlParserInputPtr’
    /home/myriam/Projets/libxml/include/libxml2/libxml/parser.h:790: error: previous declaration of ‘xmlParserInputPtr’ was here
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:87: error: expected specifier-qualifier-list before ‘xmlChar’
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:154: error: expected ‘:’, ‘,’, ‘;’, ‘}or ‘__attribute__’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:201: error: expected ‘:’, ‘,’, ‘;’, ‘}or ‘__attribute__’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:215: error: expected ‘:’, ‘,’, ‘;’, ‘}or ‘__attribute__’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:268: error: expected ‘:’, ‘,’, ‘;’, ‘}or ‘__attribute__’ before ‘*’ token
    In file included from test.c:6:
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:292:30: error: libxml/xmlregexp.h: Aucun fichier ou répertoire de ce type
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:308: error: expected ‘:’, ‘,’, ‘;’, ‘}or ‘__attribute__’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:351: error: expected ‘:’, ‘,’, ‘;’, ‘}or ‘__attribute__’ before ‘*’ token
    /home/myriam/Projets/libxml/include/libxml2/libxml/tree.h:368: error: expected ‘:’, ‘,’, ‘;’, ‘}or ‘__attribute__’ before ‘*’ token

    j'ai pas tout mis mais ça me fait ça pour chaque fichier inclus (parser.h, tree.h) etc.

    quelqu'un pourrait me dire quel est le problème svp ?

    merci d'avance
    myra

  2. #2
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    27
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2004
    Messages : 27
    Points : 22
    Points
    22
    Par défaut
    salut tout le monde,

    j'ai trouvé la solution à mon problème : il fallait que je fasse :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    gcc $(LDFLAGS) $(CPPFLAGS) -o test test.c -lxml2
    ou bien dans mon Makefile :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    CFLAGS= -lxml2
     
    ...
     
     
    $(CC) $(LDFLAGS) $(CPPFLAGS) -o $@ $^ $(CFLAGS)
    merci quand même ;-))

    @++
    Myra

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

Discussions similaires

  1. la librairie libXml++
    Par opensource dans le forum XML
    Réponses: 1
    Dernier message: 28/08/2007, 09h42
  2. edition de lien avec librairie statique
    Par vision_opencv dans le forum Linux
    Réponses: 3
    Dernier message: 06/08/2007, 01h09
  3. Réponses: 3
    Dernier message: 31/07/2007, 09h06
  4. Réponses: 2
    Dernier message: 20/04/2007, 10h21
  5. Edition de liens et librairie dynamique
    Par nicolas.pied dans le forum C++
    Réponses: 9
    Dernier message: 14/11/2005, 14h29

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