Open GoogleCodeExporter opened 8 years ago
阿,这似乎是linux专有的。以前一直没有mac用户,所以没发现。
Original comment by sthots
on 24 Sep 2009 at 5:12
你在sendpacket.h第38行加上这个试试
#define ETH_HLEN 14 /* Total octets in header. */
Original comment by sthots
on 24 Sep 2009 at 5:21
还有其他的一些宏没定义,比如 ETH_ALEN
我直接贴上 make -k 的结果吧
make all-recursive
Making all in src
gcc -DHAVE_CONFIG_H -I. -I.. -I /usr/include/libxml2 -g -O2 -DUSE_DYLIB -g0
-Os -
MT ruijieclient-blog.o -MD -MP -MF .deps/ruijieclient-blog.Tpo -c -o
ruijieclient-
blog.o `test -f 'blog.c' || echo './'`blog.c
In file included from blog.h:39,
from blog.c:35:
sendpacket.h:103: error: ‘ETH_HLEN’ undeclared here (not in a function)
make[2]: *** [ruijieclient-blog.o] Error 1
gcc -DHAVE_CONFIG_H -I. -I.. -I /usr/include/libxml2 -g -O2 -DUSE_DYLIB -g0
-Os -
MT ruijieclient-codeconv.o -MD -MP -MF .deps/ruijieclient-codeconv.Tpo -c -o
ruijieclient-codeconv.o `test -f 'codeconv.c' || echo './'`codeconv.c
In file included from codeconv.c:29:
sendpacket.h:103: error: ‘ETH_HLEN’ undeclared here (not in a function)
make[2]: *** [ruijieclient-codeconv.o] Error 1
gcc -DHAVE_CONFIG_H -I. -I.. -I /usr/include/libxml2 -g -O2 -DUSE_DYLIB -g0
-Os -
MT ruijieclient-ruijieclient.o -MD -MP -MF .deps/ruijieclient-ruijieclient.Tpo
-c -o
ruijieclient-ruijieclient.o `test -f 'ruijieclient.c' || echo
'./'`ruijieclient.c
In file included from ruijieclient.c:33:
sendpacket.h:103: error: ‘ETH_HLEN’ undeclared here (not in a function)
ruijieclient.c: In function ‘main’:
ruijieclient.c:294: warning: ‘daemon’ is deprecated (declared at
/usr/include/stdlib.h:283)
make[2]: *** [ruijieclient-ruijieclient.o] Error 1
gcc -DHAVE_CONFIG_H -I. -I.. -I /usr/include/libxml2 -g -O2 -DUSE_DYLIB -g0
-Os -
MT ruijieclient-sendpacket.o -MD -MP -MF .deps/ruijieclient-sendpacket.Tpo -c
-o
ruijieclient-sendpacket.o `test -f 'sendpacket.c' || echo './'`sendpacket.c
In file included from sendpacket.c:34:
sendpacket.h:103: error: ‘ETH_HLEN’ undeclared here (not in a function)
sendpacket.c: In function ‘GetNicParam’:
sendpacket.c:346: error: dereferencing pointer to incomplete type
sendpacket.c:346: error: dereferencing pointer to incomplete type
sendpacket.c: In function ‘SendFindServerPacket’:
sendpacket.c:419: error: ‘ETH_ALEN’ undeclared (first use in this function)
sendpacket.c:419: error: (Each undeclared identifier is reported only once
sendpacket.c:419: error: for each function it appears in.)
make[2]: *** [ruijieclient-sendpacket.o] Error 1
gcc -DHAVE_CONFIG_H -I. -I.. -I /usr/include/libxml2 -g -O2 -DUSE_DYLIB -g0
-Os -
MT ruijieclient-conn_monitor.o -MD -MP -MF .deps/ruijieclient-conn_monitor.Tpo
-c -o
ruijieclient-conn_monitor.o `test -f 'conn_monitor.c' || echo
'./'`conn_monitor.c
In file included from conn_monitor.c:31:
/usr/include/netinet/ip_icmp.h:92: error: syntax error before ‘n_short’
/usr/include/netinet/ip_icmp.h:99: error: syntax error before ‘n_short’
/usr/include/netinet/ip_icmp.h:108: error: syntax error before ‘}’ token
/usr/include/netinet/ip_icmp.h:121: error: syntax error before ‘n_time’
/usr/include/netinet/ip_icmp.h:123: error: syntax error before ‘its_ttime’
/usr/include/netinet/ip_icmp.h:126: error: field ‘idi_ip’ has incomplete
type
/usr/include/netinet/ip_icmp.h:132: error: syntax error before ‘}’ token
/usr/include/netinet/ip_icmp.h:140: error: syntax error before ‘}’ token
conn_monitor.c: In function ‘Ping’:
conn_monitor.c:68: error: storage size of ‘echo’ isn’t known
make[2]: *** [ruijieclient-conn_monitor.o] Error 1
gcc -DHAVE_CONFIG_H -I. -I.. -I /usr/include/libxml2 -g -O2 -DUSE_DYLIB -g0
-Os -
MT ruijieclient-config.o -MD -MP -MF .deps/ruijieclient-config.Tpo -c -o
ruijieclient-config.o `test -f 'config.c' || echo './'`config.c
In file included from config.c:31:
sendpacket.h:103: error: ‘ETH_HLEN’ undeclared here (not in a function)
config.c: In function ‘get_element’:
config.c:141: warning: pointer targets in assignment differ in signedness
make[2]: *** [ruijieclient-config.o] Error 1
gcc -g -O2 -DUSE_DYLIB -g0 -Os -shared -o libpcap.so -lxml2
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [libpcap.so] Error 1
make[2]: Target `all' not remade because of errors.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Original comment by Leaf...@gmail.com
on 24 Sep 2009 at 5:41
没有的定义就加上一些。我们也没有Mac 系统,没法知道。
:(
Original comment by microcai...@gmail.com
on 24 Sep 2009 at 10:24
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_HLEN 14 /* Total octets in header. */
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
#define ETH_FCS_LEN 4 /* Octets in the FCS */
一些。。。。不知道能不能用。
Original comment by sthots
on 24 Sep 2009 at 10:50
Mac用户也需要呀
Original comment by ballkids...@gmail.com
on 31 Oct 2009 at 11:25
Issue 38 has been merged into this issue.
Original comment by sthots
on 3 Dec 2009 at 9:50
Original issue reported on code.google.com by
Leaf...@gmail.com
on 24 Sep 2009 at 4:59