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

C Discussion :

compilation regex-0.12.tar.tar regex.exe


Sujet :

C

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre très actif Avatar de J4e8a16n
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    271
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 271
    Par défaut compilation regex-0.12.tar.tar regex.exe
    Bonjour,

    Je tente d'installer la biliiothèque regex avec cygwin 1.7.
    Regex.exe à été compilé avec $ make test

    Je l'ai placé dans cygwin/bin

    J'obtiens,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    etc
    rex.c:13: error: `REG_EXTENDED' undeclared (first use in this function)
    rex.c:19: warning: implicit declaration of function `regexec'
    rex.c:21: warning: implicit declaration of function `regfree'
    rex.c:39: warning: implicit declaration of function `regerror'
    etc
    Qu'est-ce qui ne va pas?

    Merci de votre attention,

    J4e8a16n

  2. #2
    Expert confirmé
    Avatar de diogene
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Juin 2005
    Messages
    5 761
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 761
    Par défaut
    Tu as oublié de faire un include du .h de la bibliothèque regex dans ton programme

  3. #3
    Membre très actif Avatar de J4e8a16n
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    271
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 271
    Par défaut
    L'include est dans le même dossier que ce programme copié collé du tutoriel regex. . .


    Il est aussi dans C:/cygwin/usr/local/include/regex.h

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    #include <stdio.h>
    #include <stdlib.h>
    #include <regex.h>
     
    int main (void)
    {
       int err;
       regex_t preg;
       const char *str_request = "www.developpez.com";
       const char *str_regex = "www\\.[-_[:alnum:]]+\\.[[:lower:]]{2,4}";
     
    /* (1) */
       err = regcomp (&preg, str_regex, REG_NOSUB | REG_EXTENDED);
    etc
    JPD

  4. #4
    Membre très actif Avatar de Goundy
    Profil pro
    Étudiant
    Inscrit en
    Avril 2005
    Messages
    605
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2005
    Messages : 605
    Par défaut
    et avec include "regex.h" ?
    Compil your life guy!
    The Aures Project

  5. #5
    Membre très actif Avatar de J4e8a16n
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    271
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 271
    Par défaut
    oui
    -------------
    ar -r C:/MinGW/lib/libregex.a C:/MinGW/lib/regex.o
    regex.h dans include de mingw32

    >mingw32-gcc -Wall -orex rex.c

    C:\Temp/ccOLHDyz.o:rex.c.text+0x51): undefined reference to `regcomp'
    C:\Temp/ccOLHDyz.o:rex.c.text+0x88): undefined reference to `regexec'
    C:\Temp/ccOLHDyz.o:rex.c.text+0x96): undefined reference to `regfree'
    C:\Temp/ccOLHDyz.o:rex.c.text+0xf4): undefined reference to `regerror'
    C:\Temp/ccOLHDyz.o:rex.c.text+0x12b): undefined reference to `regerror'
    collect2: ld returned 1 exit status


    =======================
    Pas plus de succès avec:

    libtool --mode=compile gcc -g -O -c regex.c
    libtool --mode=link gcc -g -O -o libregex.la regex.o -rpath /usr/local/lib -lm
    libtool --mode=link gcc -g -O -o regex .libs/regex.o .libs/libregex.la
    libtool --mode=install install -c libregex.la /usr/local/lib/libregex.la

    C'est désespérant.

  6. #6
    Membre très actif Avatar de J4e8a16n
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    271
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 271
    Par défaut
    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
     
    libtool --mode=compile gcc -g -O -c regex.c
    libtool --mode=link gcc -g -O -o libregex.la regex.lo  -rpath /usr/local/lib -lm
    libtool --mode=link gcc -g -O -o regex regex.o libregex.la
    libtool --mode=install install -c libregex.la /usr/local/lib
    libtool --mode=install cp regex /usr/local/bin/regex
    libtool --mode=finish  regex /usr/local/bin/regex
     
    ar t  /usr/local/lib/libregex.a
    nm -s  /usr/local/lib/libregex.a
    ls -la  /usr/local/lib/libregex.a
     
     
    # $ libtool --mode=finish  -n  /usr/local/bin/regex
    # ----------------------------------------------------------------------
    # Libraries have been installed in:
    #   /usr/local/bin/regex
     
    # $ ls -l  /usr/local/lib/libregex.a
    # -rw-r--r-- 1 Jean Pierre None 69122 Apr 14 16:37 /usr/local/lib/libregex.a
     
    # $ nm -s  /usr/local/lib/libregex.a
     
    # Archive index:
    # _re_set_syntax in regex.o
    # _re_compile_fastmap in regex.o
    # _re_set_registers in regex.o
    # _re_search in regex.o
    # _re_match in regex.o
    # _re_compile_pattern in regex.o
    # _re_comp in regex.o
    # _re_exec in regex.o
    # _regcomp in regex.o
    # _regexec in regex.o
    # _regerror in regex.o
    # _regfree in regex.o
    # _re_match_2 in regex.o
    # _re_search_2 in regex.o
    # _re_syntax_options in regex.o
    # _re_max_failures in regex.o
     
    # regex.o:
    # 00000000 b .bss
    # 00000000 d .data
    # 00000000 r .rdata
    # 00000000 N .stab
    # 00000000 N .stabstr
    # 00000000 t .text
    #         U __alloca
    #         U __imp____ctype_ptr__
    #         U _abort
    # 00005311 t _alt_match_null_string_p
    # 00002e5b t _at_begline_loc_p
    # 00002eb7 t _at_endline_loc_p
    # 00005494 t _bcmp_translate
             U _bcopy
    # 0000537d t _common_op_match_null_string_p
    # 00002f67 t _compile_range
             U _free
    # 00002f3c t _group_in_compile_stack
    # 000051df t _group_match_null_string_p
    # 00000000 t _init_syntax_once
    # 00002dde t _insert_op1
    # 00002e19 t _insert_op2
    #         U _malloc
    #        U _memset
    # 0000550b T _re_comp
    # 00000118 b _re_comp_buf
    # 0000304c T _re_compile_fastmap
    # 000054cf T _re_compile_pattern
    # 00000000 d _re_error_msg
    # 000055cf T _re_exec
    # 000036d9 T _re_match
    # 0000371c T _re_match_2
    # 00000044 D _re_max_failures
    # 0000341e T _re_search
    # 00003468 T _re_search_2
    # 000033d7 T _re_set_registers
    # 00000074 T _re_set_syntax
    # 00000000 B _re_syntax_options
    # 00000018 b _re_syntax_table
     #        U _realloc
    # 0000561b T _regcomp
    # 00005881 T _regerror
    # 00000087 t _regex_compile
    # 0000573a T _regexec
    # 00005900 T _regfree
    # 00002d9e t _store_op1
    # 00002db7 t _store_op2
    #         U _strcpy
    #         U _strncpy
    #         U _tolower
    # 00000008 b done.0
    J'imagine qu'elle est installé ?

    Alors pourquoi:
    http://nicolasj.developpez.com/articles/regex/#LIV-A

    donne
    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
     
    $ gcc -mno-cygwin -Wall -orex rex.c
    rex.c:3:19: regex.h: No such file or directory
    rex.c: In function `main':
    rex.c:8: error: `regex_t' undeclared (first use in this function)
    rex.c:8: error: (Each undeclared identifier is reported only once
    rex.c:8: error: for each function it appears in.)
    rex.c:8: error: parse error before "preg"
    rex.c:13: warning: implicit declaration of function `regcomp'
    rex.c:13: error: `preg' undeclared (first use in this function)
    rex.c:13: error: `REG_NOSUB' undeclared (first use in this function)
    rex.c:13: error: `REG_EXTENDED' undeclared (first use in this function)
    rex.c:19: warning: implicit declaration of function `regexec'
    rex.c:21: warning: implicit declaration of function `regfree'
    rex.c:28: error: `REG_NOMATCH' undeclared (first use in this function)
    rex.c:39: warning: implicit declaration of function `regerror'

Discussions similaires

  1. Compilation d'un classeur EXCEL en fichier .EXE
    Par GOLDINGMAROC dans le forum Macros et VBA Excel
    Réponses: 13
    Dernier message: 28/08/2020, 19h27
  2. [Regex C#] Aide sur une regex qui recupere des controles
    Par kerjon dans le forum Général Dotnet
    Réponses: 4
    Dernier message: 14/05/2009, 14h10
  3. Réponses: 2
    Dernier message: 04/06/2007, 20h05
  4. [RegEx] JE cherche la bonne RegEx
    Par pmartin8 dans le forum Collection et Stream
    Réponses: 2
    Dernier message: 09/11/2006, 19h13
  5. Compilation Java avec GCJ pour faire un exe. Pourquoi ?
    Par Claude URBAN dans le forum Général Java
    Réponses: 11
    Dernier message: 17/06/2006, 21h00

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