no acceptable C compiler found in $PATH

来源:互联网 发布:乐股软件官网 编辑:程序博客网 时间:2024/05/01 05:02

 

 

在CENTOS5上下载mysql-3.23.58.tar.gz

#tar -zxvf mysql-3.23.58.tar.gz

#cd mysql-3.23.58

#./configure (于检查系统是否有编译时所需的库,以及库的版本是否满足编译的需要等安装所需要的系统信息。为随后的编译工作做准备。)

提示错误如下:(没有GCC编译器环境)

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking whether make sets $(MAKE)... yes
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure:
error:no acceptable C compiler found in $PATH

百度一下,有个解说如下:

------------------------------------------

经过查阅资料,发现是因为没有安装GCC组件的原因;

我试着通过System settings中的Add/RemoveApplications来添加/删除组件,选中开发工具中相应的项,点击update,提示插入disk1,我插入光盘,但不起作用,不知是不是因为在虚拟机中的原因...没办法了,手动安装,我放入redhat 工具盘,拷出了gcc*.rpm,然后共享至虚拟机中的linux 中,安装,提示缺少其他一些组件,最后经过来回搜索与拷贝,GCC安装成功,所需文件有:

libf2c-3.3.2-1.i386.rpm
libstdc++-devel-3.3.2-1.i386.rpm
glibc-kernheaders-2.4-8.36.i386.rpm
glibc-headers-2.3.2-101.i386.rpm
glibc-devel-2.3.2-101.i386.rpm
gcc-objc-3.3.2-1.i386.rpm
binutils-2.14.90.0.6-3.i386.rpm
gcc-3.3.2-1.i386.rpm
gcc-c++-3.3.2-1.i386.rpm
automake14-1.4p6-7.noarch.rpm

安装比较简单:
#rpm -ivh rpm文件

------------------------------------------

自己的解决办法:(在线安装gcc)

# yum -y install gcc
base 100% |=========================| 1.1 kB00:00
updates 100% |=========================|951 B 00:00
addons 100% |=========================|951 B 00:00
extras 100% |=========================| 1.1 kB00:00

Installed: gcc.i386 0:4.1.2-42.el5
Dependency Installed: cpp.i386 0:4.1.2-42.el5 glibc-devel.i386 0:2.5-24.el5_2.2 glibc-headers.i386 0:2.5-24.el5_2.2 kernel-headers.i386 0:2.6.18-92.1.22.el5 libgomp.i386 0:4.1.2-42.el5
Updated: glibc.i686 0:2.5-24.el5_2.2 glibc-common.i386 0:2.5-24.el5_2.2
Complete!

---------------------------------------------------

安装完GCC以后再重新编译

#./configure

提示如下:

----------------

configure: error: This is a linux system and Linuxthreads was not
found. On linux Linuxthreads should be used. Please install Linuxthreads
(or a new glibc) and try again. See the Installation chapter in the
Reference Manual for more information.
----------------

再百度,找到一个解决办法如下:

-------------------------

将线程源码放到MySql源码目录的根目录下以mit-pthreads命名的目录。官方没有自己去下一个也是一样的,只要解压后放到上述位置就可了。 pthread-20020327.tar.gz

于是去下了一个pthread源码包(下面有下载),解压放到相应位置。

#./configure--prefix=/usr/local/mysql --with-mit-threads

就顺利通过了。

--------------------------
以上的意思就是在 MySql源码目录 新建立mit-pthreads 然后下载pthread-20020327.tar.gz包 然后解压包内的所有文件到 mit-pthreads目录下然后#./configure--prefix=/usr/local/mysql --with-mit-threads

(我的目录是#./configure --prefix=/root/mysql-3.23.58 --with-mit-threads)

可惜执行到最后又提示 如下错误:

checking for termcap functions library... configure: error: No curses/termcap library found

再再百度一下 如下:

------------------------------------------------------

需要安装ncurses-5.2.tar.gz,安装好之后把安装路径设置到PATH中。

虽然是老帖子了 我最近也碰到了办法如下:
./configure --with-named-curses-libs=/usr/lib/libncursesw.so.5
原创粉丝点击