Description:
When attempting to run "make" on mysql-4.0.14, the following error occurs:
gcc -DDEFAULT_CHARSET_HOME=\"/mysql\" -DDATADIR=\"/mysql/var\"
-DSHAREDIR=\"/mysql/share/mysql\" -DUNDEF_THREADS_HACK
-DDONT_USE_RAID -DMYSQL_CLIENT -I. -I. -I.. -I./../include
-I../include -I./.. -I.. -I.. -O3 -DDBUG_OFF -c libmysql.c -MT
libmysql.lo -MD -MP -MF .deps/libmysql.TPlo -fPIC -DPIC -o
.libs/libmysql.lo
libmysql.c: In function `mysql_real_connect':
libmysql.c:1783: warning: passing arg 5 of `gethostbyname_r' from
incompatible pointer type
libmysql.c:1783: too few arguments to function `gethostbyname_r'
libmysql.c:1783: warning: assignment makes pointer from integer
without a cast
make[2]: *** [libmysql.lo] Error 1
make[2]: Leaving directory `/usr/src/mysql-4.0.14/libmysql'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/mysql-4.0.14'
make: *** [all] Error 2
my compile command sequence was:
#> ./configure --prefix=/mysql
#> make
The configure passed without incident.
Compile environment:
gcc: 3.2
make: 3.79.1
SuSE Linux Enterprise Server version 8, running k_smp 2.4.19-333
IBM xServer 360, 1024 MB RAM, 1.8 GB swap, 10 GB HDD.
How to repeat:
Untar source tarball
create install directory /mysql (in my case, it was a separate partition mounted to
/mysql)
cd into source tree
run configure script with --prefix=/mysql
run make
Suggested fix:
That, I couldn't give ya. I have looked at the code and my_real_connect is defining arg 5
(tmp_errno) as an int, then passing it by reference to my_gethostbyname_r, which expects
an int * as an arg there. Looks fine, but it still won't compile.
----------------------------------------------------------------
By default, the configure script attempts to determine the correct number of arguments by
using g++ the GNU C++ compiler. This test yields wrong results, if g++ is not installed.
There are two ways to work around this problem:
* Make sure that the GNU C++ g++ is installed. On some Linux distributions, the
required package is called gpp, on others it is named gcc-c++.
* Use gcc as your C++ compiler by setting the CXX environment variable to gcc:
export CXX="gcc"
Please note that you need to run configure again afterwards.
----------------------------------
make: *** [all] Error 2
解决:
修改config.h文件,添加如下一句:
#define HAVE_GETHOSTBYNAME_R_RETURN_INT 1
然后重新 ./configure make 即可
阅读(7574) | 评论(0) | 转发(0) |