安装iptstate报错

 在rhel6.2_64上安装iptstate-2.1.tar.bz2

[root@gw-175 data]# tar -xjf iptstate-2.1.tar.bz2 

[root@gw-175 data]# cd iptstate-2.1

[root@gw-175 iptstate-2.1]# make

+------------------------------------------------------------+

| Welcome to IP Tables State by Phil Dibowitz                |

|                                                            |

| PLEASE read the LICENSE and the README for important info. |

|                                                            |

| You may also wish to read the README for install info,     |

| the WISHLIST for upcoming features, BUGS for known bugs    |

| and info on bug reports, and the Changelog to find out     |

| what's new.                                                |

|                                                            |

| Let's compile...                                           |

+------------------------------------------------------------+

 

g++ -g -Wall -O2 iptstate.cc -o iptstate -lncurses

iptstate.cc: In function ‘void build_table(const flags_t&, const filters_t&, std::vector<table_t, std::allocator<table_t> >&, counters_t&, max_t&)’:

iptstate.cc:809: 错误:‘strerror’在此作用域中尚未声明

iptstate.cc: In function ‘void print_table(std::vector<table_t, std::allocator<table_t> >&, const flags_t&, const std::string&, const std::string&, const filters_nters_t&, const screensize_t&, const max_t&, WINDOW*)’:

iptstate.cc:1114: 警告:格式‘%i’需要类型‘int’,但实参 2 的类型为‘size_t’

iptstate.cc: In function ‘int src_sort(const void*, const void*)’:

iptstate.cc:1969: 错误:‘memcmp’在此作用域中尚未声明

iptstate.cc: In function ‘int dst_sort(const void*, const void*)’:

iptstate.cc:1974: 错误:‘memcmp’在此作用域中尚未声明

make: *** [iptstate] 错误 1

搜到国外的一个帖子(http://www.linuxquestions.org/questions/linux-newbie-8/established-connections-706729/),这样说

I just figured this out today.

Its likely you're running gcc 4.3.2 like me and some of the include files arent included by default by gcc for c++.

if you go into iptstate.cc and add a line near the top with the rest of the includes:

#include <cstring> 

It should compile.

If it doesnt, then you might look to make sure your compiler is complete.


I think this gets fixed in 4.3.3, but i'm not in a hurry to compile or download 4.3.3.

Hope this helps.

Dennis

成功!记录一下。

你可能感兴趣的:(welcome)