1
试图编译一个使用pcap.h的基本程序。我在我的Mac OSX盒子上设置了环境,该盒子为iPhone 3GS使用iPhone 3.1.3 SDK。我还安装了libpcap到〜/ libpcap,以便我可以告诉gcc使用-I标志查找标头的位置。但是,它会失败并发出ld警告,说该文件不是所需的体系结构。libpcap可以编译为iPhone/armv6吗?
我有以下行编译:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -I /Users/abnev/libpcap/include -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk -o pcap pcap.c -lpcap
产生错误的存在是:
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/usr/lib/libpcap.dylib, file is not of required architecture
Undefined symbols:
"_pcap_geterr", referenced from:
_main in ccOL3e0B.o
_main in ccOL3e0B.o
"_pcap_open_live", referenced from:
_main in ccOL3e0B.o
"_pcap_next", referenced from:
_main in ccOL3e0B.o
"_pcap_lookupdev", referenced from:
_main in ccOL3e0B.o
"_pcap_setfilter", referenced from:
_main in ccOL3e0B.o
"_pcap_lookupnet", referenced from:
_main in ccOL3e0B.o
"_pcap_close", referenced from:
_main in ccOL3e0B.o
"_pcap_compile", referenced from:
_main in ccOL3e0B.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
现在我认为我需要重新编译为ARMv6体系结构(iPhone),但检查的libpcap ./configure选项不起作用。我已经尝试过谷歌周围的这个,但是那里几乎没有。