【发布时间】:2016-11-22 23:25:48
【问题描述】:
我正在尝试构建和安装 Apache Thrift 编译器和库
我必须键入此命令,说明中显示
./configure && make
但我得到这个错误:
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
当我输入命令提示符时
gcc --version我明白了
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.
它会找到 gcc 编译器。但是,当我从 msys2 Shell 运行它时
bash: gcc: command not found
环境变量中的路径是正确的。 C:\MinGW\bin
却找不到gcc
提前致谢!
【问题讨论】:
-
你是在
cygwin环境中运行./configure && make还是类似window 的linux 子系统?如果是,则需要cygwin或Window 的Linux 子系统自带的gcc。 -
我使用的是 Win10 操作系统
-
确实是。但是
bash不是 Windows 10 原生的,所以你必须运行 Window 的 linux 子系统。尝试从bash中安装 gcc。 -
@alvits 我做到了。我使用这个命令
pacman -S mingw-w64-x86_64-gcc来安装 gcc 包,还有其他建议吗? -
当你在
bash里面时,$PATH的值是多少?更新路径以添加 gcc 和其他 binutils 的位置。您将需要它们。