centos6.5,编译安装mysql5.1.27时遇到以下下错误,查看了一下系统没有安装gcc-c++,于是用yum安装,命令:yum install -y gcc-c++
报错1: ../depcomp: line 512: exec: g++: not found make[2]: *** [my_new.o] Error 127 make[2]: Leaving directory `/usr/local/src/mysql-5.0.41/mysys' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/mysql-5.0.41' make: *** [all] Error 2 解决方法:yum install -y gcc-c++
安装完gcc-c++之后,直接编译make,继续报错,错误如下:
报错2: ../include/my_global.h:909: error: redeclaration of C++ built-in type `bool'make[2]: *** [my_new.o] Error 1make[2]: Leaving directory `/home/tools/mysql-5.0.22/mysys'make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/home/tools/mysql-5.0.22'make: *** [all] Error 2 解决方法:重新configure,然后编译安装
最后网上搜素发现,gcc-c++实在configure之后安装的,导致安装报错,于是重新configure,然后make,make install才安装成功
转载于:https://blog.51cto.com/youdong/1726629