月度归档:2013年03月

安装编译gd时出错,排错一例

如果在编译的时候出现错误:gd_png.c:15:53: error: png.h: No such file or directory,解决如下:
# vi gd_png.c
# 找到行: #include “png.h” /* includes zlib.h and setjmp.h */
修改为: #include “/usr/local/libpng/include/png.h” /* includes zlib.h and setjmp.h */
编译make时,继续出错,zlib.h的,修改/usr/loca/libpng/include/png.h,搜索定位找到zlib.h,给出全路径,然后保存退出,继续gd的make,ok了

RTNETLINK answers: no such process

双线双ip,碰到的问题,RTNETLINK answers: no such process,电信能通,但是网通不通,网上找的解决办法,如下:
1.当前路由表是否齐全

cat /etc/iproute2/rt_tables

2.相应ip配置是否正确

ip ro add default via 192.168.0.1 dev eth0
注意:当前eth0 一定要有192.168.0.0/24网段的ip

3.当前网卡物理连接是否正常
ethtool eth0

异常处理:

1。清空iptables

2。重启机器

libxml2-2.6.23编译,make时错误

Gentoo上编译libxml2-2.6.23上出错,解决办法如下,gcc太新的问题

/usr/include/bits/fcntl2.h:51: 错误: 调用‘__open_missing_mode’,声明有错误属性:open with O_CREAT in second argument needs 3 arguments

网上查了一下,说是gcc-4.3对语法检查严格的结果,找到出错的那一句,在我编译的程序里是这句
int fd = open(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC);
将之改为
int fd = open(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0777);
就OK了