Problema compilazione su ubuntu 64b

Help
dozpav
2012-01-11
2013-04-11
  • dozpav
    dozpav
    2012-01-11

    Ho riscontrato questo errore in fase di compilazione, non riesco a superare questo ostacolo, mi chiedevo se per caso qualcuno aveva avuto lo stesso problema. Confido molto nell'utilizzo di questo parser per motivi di studio..

    sudo make
    Making all in ixe
    make: ingresso nella directory "/home/dozer/Scaricati/desr-1.2.2/ixe"
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c conf/conf.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c conf/conf_bool.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c conf/conf_float.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c conf/conf_int.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c conf/conf_set.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c conf/conf_string.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c Common/OptionStream.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c io/File.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c io/FileHandle.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c io/Format.cpp
    g++  -g -O2  -fPIC -DPIC  -I. -I.. -c io/mappedFile.cpp
    /usr/bin/ar cr libixe.a conf/conf.lo conf/conf_bool.lo conf/conf_float.lo conf/conf_int.lo conf/conf_set.lo conf/conf_string.lo Common/OptionStream.lo io/File.lo io/FileHandle.lo io/Format.lo io/mappedFile.lo
    test ! -f ranlib || ranlib libixe.a
    make: uscita dalla directory "/home/dozer/Scaricati/desr-1.2.2/ixe"
    Making all in text
    make: ingresso nella directory "/home/dozer/Scaricati/desr-1.2.2/text"
    Making all in pcre
    make: ingresso nella directory "/home/dozer/Scaricati/desr-1.2.2/text/pcre"
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_chartables.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_compile.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_exec.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_fullinfo.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_get.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_globals.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_info.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_newline.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_maketables.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_ord2utf8.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_study.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_tables.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_try_flipped.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_ucp_searchfuncs.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_valid_utf8.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_version.c
    gcc  -g -O2 -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_xclass.c

    -- Building static library: libpcre.a

    /usr/bin/ar cr libpcre.a pcre_chartables.o pcre_compile.o pcre_exec.o pcre_fullinfo.o pcre_get.o pcre_globals.o pcre_info.o pcre_newline.o pcre_maketables.o pcre_ord2utf8.o pcre_study.o pcre_tables.o pcre_try_flipped.o pcre_ucp_searchfuncs.o pcre_valid_utf8.o pcre_version.o pcre_xclass.o
    ranlib libpcre.a
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_chartables.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_compile.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_exec.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_fullinfo.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_get.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_globals.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_info.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_newline.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_maketables.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_ord2utf8.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_study.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_tables.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_try_flipped.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_ucp_searchfuncs.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_valid_utf8.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_version.c
    gcc  -g -O2  -fPIC -DPIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10  -c pcre_xclass.c

    -- Building dynamic library: libpcre.so

    /usr/bin/ar cr libpcre.so pcre_chartables.lo pcre_compile.lo pcre_exec.lo pcre_fullinfo.lo pcre_get.lo pcre_globals.lo pcre_info.lo pcre_newline.lo pcre_maketables.lo pcre_ord2utf8.lo pcre_study.lo pcre_tables.lo pcre_try_flipped.lo pcre_ucp_searchfuncs.lo pcre_valid_utf8.lo pcre_version.lo pcre_xclass.lo
    ranlib libpcre.so
    make: uscita dalla directory "/home/dozer/Scaricati/desr-1.2.2/text/pcre"
    Making all in .
    make: ingresso nella directory "/home/dozer/Scaricati/desr-1.2.2/text"
    make: ingresso nella directory "/home/dozer/Scaricati/desr-1.2.2/text"
    g++  -g -O2  -I. -I.. -I../ixe -c charmap.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c HtmlTokenizer.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c RegExp.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c StreamTokenizer.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c strings.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c StringTokenizer.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c Suffixes.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c WordSet.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c Encoding.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c Char.cpp
    g++  -g -O2  -I. -I.. -I../ixe -c String.cpp
    In file included from String.h:28:0,
                     from String.cpp:24:
    CharBuffer.h:72:11: error: ‘ptrdiff_t’ does not name a type
    CharBuffer.h:111:5: error: ‘Distance’ does not name a type
    CharBuffer.h:148:3: error: ‘Distance’ does not name a type
    CharBuffer.h:152:3: error: ‘Distance’ does not name a type
    CharBuffer.h: In constructor ‘Tanl::Text::CharBuffer<CharTraits>::CharBuffer(Tanl::Text::CharBuffer<CharTraits>::CharType*, size_t)’:
    CharBuffer.h:76:5: error: class ‘Tanl::Text::CharBuffer<CharTraits>’ does not have any field named ‘length’
    CharBuffer.h: In member function ‘Tanl::Text::CharBuffer<CharTraits>::iterator Tanl::Text::CharBuffer<CharTraits>::end()’:
    CharBuffer.h:143:44: error: ‘length’ was not declared in this scope
    CharBuffer.h: In member function ‘Tanl::Text::CharBuffer<CharTraits>::const_iterator Tanl::Text::CharBuffer<CharTraits>::end() const’:
    CharBuffer.h:146:62: error: ‘length’ was not declared in this scope
    In file included from String.cpp:24:0:
    String.h: In constructor ‘Tanl::Text::String::String(Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator, Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator)’:
    String.h:87:19: error: ambiguous overload for ‘operator-’ in ‘e - b’
    String.h:87:19: note: candidates are:
    String.h:87:19: note: operator-(const CodeUnit* {aka const short unsigned int*}, const CodeUnit* {aka const short unsigned int*}) <built-in>
    String.h:87:19: note: operator-(Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator::CodeUnit* {aka short unsigned int*}, Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator::CodeUnit* {aka short unsigned int*}) <built-in>
    String.h:87:19: note: operator-(const CodeUnit* {aka const short unsigned int*}, const CodeUnit* {aka const short unsigned int*}) <built-in>
    String.h:87:19: note: operator-(const CodeUnit* {aka const short unsigned int*}, const CodeUnit* {aka const short unsigned int*}) <built-in>
    String.h:87:19: note: operator-(Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator::CodeUnit* {aka short unsigned int*}, Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator::CodeUnit* {aka short unsigned int*}) <built-in>
    String.h:87:19: note: operator-(Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator::CodeUnit* {aka short unsigned int*}, Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator::CodeUnit* {aka short unsigned int*}) <built-in>
    CharBuffer.h:109:14: note: Tanl::Text::CharBuffer<CharTraits>::iterator Tanl::Text::CharBuffer<CharTraits>::iterator::operator-(int) const  <near match>
    CharBuffer.h:109:14: note:   no known conversion for argument 1 from ‘Tanl::Text::CharBuffer<Tanl::Text::Char>::iterator’ to ‘int’
    make: ***  Errore 1
    make: uscita dalla directory "/home/dozer/Scaricati/desr-1.2.2/text"
    make: ***  Errore 2
    make: uscita dalla directory "/home/dozer/Scaricati/desr-1.2.2/text"
    make: ***  Errore 1
    make: uscita dalla directory "/home/dozer/Scaricati/desr-1.2.2/text"
    make: ***  Errore 1

     
  • La soluzione consiste nell'aggiungere questa riga

    #include <stddef.h>

    a tex/CharBuffer.h

    Stranamente nel nuovo compilatore su ubuntu 12 il tipo ptrdiff_t, che è un tipo standard, richiede questo include.

    Grazie per la segnalazione.