Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5613

::realloc has not been declared

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.16.0
    • None
    • C++ - Compiler
    • None

    Description

      I want to compile thrift for arm by my company's cross compiler.

      After running bootstrap and configure with proper parameters, then run make. An error occured:

      make[4]: Entering directory `/root/build/thrift-0.16.0/lib/cpp'
      depbase=`echo src/thrift/TApplicationException.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
      /bin/sh ../../libtool  --tag=CXX   --mode=compile aarch64-kedacom-linux-gnu-g++ -std=c++11 -DHAVE_CONFIG_H     -I./src -D_STDC_FORMAT_MACROS -D_STDC_LIMIT_MACROS -march=armv8-a -Wall -Wextra -pedantic -march=armv8-a -MT src/thrift/TApplicationException.lo -MD -MP -MF $depbase.Tpo -c -o src/thrift/TApplicationException.lo src/thrift/TApplicationException.cpp &&\
      mv -f $depbase.Tpo $depbase.Plo
      libtool: compile:  aarch64-kedacom-linux-gnu-g++ -std=c++11 -DHAVE_CONFIG_H -I./src -D_STDC_FORMAT_MACROS -D_STDC_LIMIT_MACROS -march=armv8-a -Wall -Wextra -pedantic -march=armv8-a -MT src/thrift/TApplicationException.lo -MD -MP -MF src/thrift/.deps/TApplicationException.Tpo -c src/thrift/TApplicationException.cpp  -fPIC -DPIC -o src/thrift/.libs/TApplicationException.o
      In file included from /opt/aarch64-kedacom-linux/aarch64-kedacom-linux-gnu/include/c++/8.3.0/ext/string_conversions.h:41,
                       from /opt/aarch64-kedacom-linux/aarch64-kedacom-linux-gnu/include/c++/8.3.0/bits/basic_string.h:6400,
                       from /opt/aarch64-kedacom-linux/aarch64-kedacom-linux-gnu/include/c++/8.3.0/string:52,
                       from ./src/thrift/Thrift.h:37,
                       from ./src/thrift/TApplicationException.h:23,
                       from src/thrift/TApplicationException.cpp:20:
      /opt/aarch64-kedacom-linux/aarch64-kedacom-linux-gnu/include/c++/8.3.0/cstdlib:164:11: error: ‘::realloc’ has not been declared
         using ::realloc;
                 ^~~~~~~
      make[4]: *** [src/thrift/TApplicationException.lo] Error 1
      make[4]: Leaving directory `/root/build/thrift-0.16.0/lib/cpp'
      make[3]: *** [all-recursive] Error 1
      make[3]: Leaving directory `/root/build/thrift-0.16.0/lib/cpp'
      make[2]: *** [all-recursive] Error 1
      make[2]: Leaving directory `/root/build/thrift-0.16.0/lib'
      make[1]: *** [all-recursive] Error 1
      make[1]: Leaving directory `/root/build/thrift-0.16.0'
      make: *** [all] Error 2

       

      How to solve it?

      Some people show the solution below. But that's for version 0.9.0. Not suitable for 0.16.0 as no such lines in config.h.

      To delete two lines in config.h:

      #define malloc rpl_malloc
      #define realloc rpl_realloc

      Attachments

        Activity

          People

            Unassigned Unassigned
            atptour2017 chendan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: