Search code examples
thrift

Why is Apache Thrift installation failing at make command?


I am trying to install Apache Thrift on Windows 7 via Cygwin. I tried using the exe installer but that didn't work (only a command prompt was opened and closed). Then I tried installing through making a build through Cygwin but ran into this error.

 $ make
make  all-recursive
make[1]: Entering directory '/cygdrive/f/Thrift Practice/thrift-0.9.2'
Making all in compiler/cpp
make[2]: Entering directory '/cygdrive/f/Thrift Practice/thrift-0.9.2/compiler/cpp'
make  all-am
make[3]: Entering directory '/cygdrive/f/Thrift Practice/thrift-0.9.2/compiler/cpp'
source='thriftl.cc' object='libparse_a-thriftl.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../../depcomp \
g++ -DHAVE_CONFIG_H -I. -I../.. -I../../lib/cpp/src/thrift  -I./src  -Wall -Wno-sign-compare -Wno-unused -g -O2 -std=c++11 -c -o libparse_a-thriftl.o `test -f 'thriftl.cc' || echo './'`thriftl.cc
thriftl.cc: In function ‘void yy_init_buffer(YY_BUFFER_STATE, FILE*)’:
thriftl.cc:3399:60: error: ‘fileno’ was not declared in this scope
         b->yy_is_interactive =  file ? (isatty( fileno(file) ) > 0) : 0;
                                                            ^
Makefile:751: recipe for target 'libparse_a-thriftl.o' failed
make[3]: *** [libparse_a-thriftl.o] Error 1
make[3]: Leaving directory '/cygdrive/f/Thrift Practice/thrift-0.9.2/compiler/cpp'
Makefile:539: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/cygdrive/f/Thrift Practice/thrift-0.9.2/compiler/cpp'
Makefile:531: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/f/Thrift Practice/thrift-0.9.2'
Makefile:452: recipe for target 'all' failed
make: *** [all] Error 2

I tried changing the variable :

b->yy_is_interactive = 0 ;

but that resulted in some other error ( ‘realpath’ was not declared in this scope). I have checked through other related question Apache thrift can not make but I have all the requirements meet to run Thrift


Solution

  • If you use the EXE installer in Windows, there is no need for Cygwin. The EXE installer installs Thrift.EXE.

    The runtime library can be used out of the repository branch, there are build projects for Visual Studio.

    And on top of it there's even a VS build project for the Thrift compiler itself. Isn't that great?


    PS: https://thrift.apache.org/docs/install/windows is slightly outdated. Thanks for the heads up.