10

I am trying to Build and Install the Apache Thrift compiler and libraries

I had to type this command is shown in instructions ./configure && make But I get this error:

checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/PATH/TO/thrift-0.9.3':
configure: error: no acceptable C compiler found in $PATH

When I type in my command prompt gcc --version I get this

gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It finds the gcc compiler. However, when I run it from my msys2 Shell

bash: gcc: command not found

The path in Environment variables is correct. C:\MinGW\bin

Yet it canno't find gcc

Thanks in advance!

Tony Tannous
  • 14,154
  • 10
  • 50
  • 86
  • Are you running `./configure && make` in a `cygwin` environment or something similar such as window's linux subsystem? If yes, you need the gcc that comes with `cygwin` or Window's Linux Subsystem. – alvits Nov 22 '16 at 23:37
  • I'm on Win10 OS – Tony Tannous Nov 22 '16 at 23:37
  • 1
    Indeed you are. But `bash` is not native to Windows 10, so you must be running Window's subsystem for linux. Try installing gcc from within `bash`. – alvits Nov 22 '16 at 23:38
  • @alvits I did. I used this command `pacman -S mingw-w64-x86_64-gcc` to install gcc packages, any other suggestions ? – Tony Tannous Nov 22 '16 at 23:40
  • When you are inside `bash`, what's the value of `$PATH`? Update the path to add the location of gcc and other binutils. You'll need them all in make. – alvits Nov 22 '16 at 23:42
  • @alvits after trying `$PATH` I get this `/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/ProgramData/Oracle/Java/javapath:/c/ProgramData/Oracle/Java/javapath/bin:/c/Program: No such file or directory` And for some reason I can't find here gcc. Is that the problem ? or am I missing something ? Thanks in advance. – Tony Tannous Nov 22 '16 at 23:44
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/128760/discussion-between-tony-tannous-and-alvits). – Tony Tannous Nov 22 '16 at 23:45

5 Answers5

14

The path to your gcc compiler is not in the PATH.

You may add it before you run make.

export PATH=${PATH}:/c/MinGW/bin
./configure && make

Goodluck.

alvits
  • 6,550
  • 1
  • 28
  • 28
3

I'm on Win10 OS

There is a Visual Studio project file for the compiler. Either use that one, or download the compiler binary for Windows directly from the website.

JensG
  • 13,148
  • 4
  • 45
  • 55
  • Just got an upvote so I re read the thread, indeed having visual studio makes life easier. Had to install dlib package and had the same issure as this thread, worked out after installing visual studio 15 – Tony Tannous Apr 15 '19 at 07:07
1

If it is centos/redhat machine install full set of development package

$ sudo yum groups install "Development Tools"

it includes gcc,g++,make Id. After installing try again

Rakib
  • 1,966
  • 1
  • 11
  • 15
0

This tread is old, however, it worked for me by enabling "set MSYS2_PATH_TYPE=inherit" in the startup script. Running mingw64.exe in the root of MSYS2 worked as well.

0

For the future: If on Windows 10 and MSYS2. I uncommented the line

set MSYS2_PATH_TYPE=inherit

on msys2_shell.cmd, so it just inherits the path where you put everything on windows.

I'm surprised this is not the default!

Wilmer E. Henao
  • 4,094
  • 2
  • 31
  • 39