configure: error: no acceptable C compiler found in $PATH
Asked Answered
V

5

11

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!

Vivisect answered 22/11, 2016 at 23:25 Comment(7)
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.Concentration
I'm on Win10 OSVivisect
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.Concentration
@Concentration I did. I used this command pacman -S mingw-w64-x86_64-gcc to install gcc packages, any other suggestions ?Vivisect
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.Concentration
@Concentration 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.Vivisect
Let us continue this discussion in chat.Vivisect
C
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.

Concentration answered 22/11, 2016 at 23:49 Comment(1)
For MinGW-w64 installed from MSYS2: export PATH=$PATH:/mingw64/bin.Capful
D
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.

Drislane answered 23/11, 2016 at 14:27 Comment(1)
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 15Vivisect
L
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

Lavender answered 23/11, 2016 at 4:22 Comment(0)
S
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.

Sacrament answered 2/9, 2019 at 0:13 Comment(0)
T
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!

Trevino answered 30/1, 2020 at 18:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.