Hey,
Trying to compile a basic program which uses pcap.h. I've set up the environment on my Mac OSX box which uses the iPhone 3.1.3 SDK for an iPhone 3GS. I've also installed libpcap to ~/libpcap so I can tell gcc where to look for the headers using the -I flag. However, it fails with an ld warning saying the file is not of the required architecture.
I'm compiling with the following line:
/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
Error's being generated are:
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
I assume now that I need to recompile libpcap for the armv6 architecture (iPhone) but checking the ./configure options doesn't help. I've attempted to Google around for this but there is very little out there. Any ideas?
Thanks,
A