2015-10-19 102 views
0

编译hexinject当从源代码使用make我得到这个错误在OS X上编译hexinject错误在OS X

In file included from hexinject.c:8: 
In file included from ./hexinject.h:22: 
./hexpcap.h:309:12: warning: returning 'const char *' from a function with result type 'const uint8_t *' 
     (aka 'const unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign] 
    return raw; 
      ^~~ 
10 warnings generated. 
Undefined symbols for architecture x86_64: 
    "_field_print", referenced from: 
     _tcp_print in hexinject-0a9735.o 
     _udp_print in hexinject-0a9735.o 
     _icmp_print in hexinject-0a9735.o 
     _igmp_print in hexinject-0a9735.o 
     _ip_print in hexinject-0a9735.o 
     _arp_print in hexinject-0a9735.o 
     _ethernet_print in hexinject-0a9735.o 
     ... 
    "_protocol_16bit_extract", referenced from: 
     _ethernet_print in hexinject-0a9735.o 
     _llc_print in hexinject-0a9735.o 
    "_protocol_48bit_extract", referenced from: 
     _ethernet_print in hexinject-0a9735.o 
    "_protocol_8bit_extract", referenced from: 
     _ip_print in hexinject-0a9735.o 
     _isl_print in hexinject-0a9735.o 
     _llc_print in hexinject-0a9735.o 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
make: *** [all] Error 1 

我已经安装libpcaptcl。我该如何解决这个错误?

回答

1

在这里看到:http://sourceforge.net/p/hexinject/bugs/3/

打开prettypacket.h和从下列功能

protocol_8bit_extractprotocol_16bit_extractprotocol_48bit_extract, 和field_print

除去inline关键字然后用make编译照常