安裝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

成功!記錄一下。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章