make: *** [all] Error 2 while make

20,205

This is the relevant error:

src/thrifty.yy: In function 'int yyparse()':
src/thrifty.yy:1309:30: error: 'strdup' was not declared in this scope

Probably an include is missing. You may try to add

 #include <string.h>

to the top of the file src/thrifty.yy

And report the bug to the http://incubator.apache.org/projects/thrift.html

Share:
20,205

Related videos on Youtube

Tony Tannous
Author by

Tony Tannous

Sunspots have faded and now I'm doing time.

Updated on September 18, 2022

Comments

  • Tony Tannous
    Tony Tannous over 1 year

    Trying to Build and Install the Apache Thrift compiler and libraries -

    ./configure && make

    But then I get make error which I don't seem to understand where it fails...

    thrift 0.9.3
    
    Building C++ Library ......... : no
    Building C (GLib) Library .... : no
    Building Java Library ........ : no
    Building C# Library .......... : no
    Building Python Library ...... : no
    Building Ruby Library ........ : no
    Building Haxe Library ........ : no
    Building Haskell Library ..... : no
    Building Perl Library ........ : no
    Building PHP Library ......... : no
    Building Erlang Library ...... : no
    Building Go Library .......... : no
    Building D Library ........... : no
    Building NodeJS Library ...... : no
    Building Lua Library ......... : no
    
    If something is missing that you think should be present,
    please skim the output of configure to find the missing
    component.  Details are present in config.log.
    make  all-recursive
    make[1]: Entering directory '/c/University/InternetOfThings/thrift-0.9.3'
    Making all in compiler/cpp
    make[2]: Entering directory '/c/University/InternetOfThings/thrift-0.9.3/compile                                                                                                                                                 r/cpp'
    make  all-am
    make[3]: Entering directory '/c/University/InternetOfThings/thrift-0.9.3/compile                                                                                                                                                 r/cpp'
    g++ -DHAVE_CONFIG_H -I. -I../.. -I../../lib/cpp/src/thrift  -I./src  -Wall -Wno-                                                                                                                                                 sign-compare -Wno-unused -g -O2 -std=c++11 -MT src/libparse_a-thrifty.o -MD -MP                                                                                                                                                  -MF src/.deps/libparse_a-thrifty.Tpo -c -o src/libparse_a-thrifty.o `test -f 'sr                                                                                                                                                 c/thrifty.cc' || echo './'`src/thrifty.cc
    src/thrifty.yy: In function 'int yyparse()':
    src/thrifty.yy:1309:30: error: 'strdup' was not declared in this scope
    Makefile:912: recipe for target 'src/libparse_a-thrifty.o' failed
    make[3]: *** [src/libparse_a-thrifty.o] Error 1
    make[3]: Leaving directory '/c/University/InternetOfThings/thrift-0.9.3/compiler                                                                                                                                                 /cpp'
    Makefile:588: recipe for target 'all' failed
    make[2]: *** [all] Error 2
    make[2]: Leaving directory '/c/University/InternetOfThings/thrift-0.9.3/compiler                                                                                                                                                 /cpp'
    Makefile:609: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/c/University/InternetOfThings/thrift-0.9.3'
    Makefile:530: recipe for target 'all' failed
    make: *** [all] Error 2
    

    Help will be appreciated. Thanks in advance!

    • terdon
      terdon over 7 years
      @countermode this is 100% on topic! The OP hasn't written this software, they are trying to install it. And that error is not very helpful if you're not a C programmer. This is a user asking for help installing software in their Linux machine, and so is on topic.
  • Tony Tannous
    Tony Tannous over 7 years
    Same error unfortunately.
  • drHogan
    drHogan over 7 years
    Maybe try ./configure CXXFLAGS="-std=gnu++11". You can check grep HAVE_STRDUP config.h after running ./configure. See also stackoverflow.com/questions/5573775/strdup-error-on-g-with-c‌​0x