免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2510 | 回复: 0

make[2]: *** [libmysql.lo] Error 1 [复制链接]

论坛徽章:
0
发表于 2011-12-22 08:53 |显示全部楼层
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 即可
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP