Kismet Wireless

Kismet Forums

 

Posted by:micmo
Subject:Building & Debugging Android-Pcap failes - pcap library missing
Date:18:47:44 28/02/2013

Hi again,

Sorry for the late response. I now have the NDK on my machine but when I do an ndk-build, it throws an error about 'undefined references':

===========================
android@android-vm:~/workspace/PcapCapture$ ~/android-ndk-r8d/ndk-build
....
....
SharedLibrary : libpcap.so
/home/android/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/pcap/libpcap-1.3.0/pcap-linux.o: in function pcap_create:jni/libpcap-1.3.0/pcap-linux.c:434: error: undefined reference to 'can_create'
/home/android/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/pcap/libpcap-1.3.0/pcap-linux.o: in function pcap_create:jni/libpcap-1.3.0/pcap-linux.c:440: error: undefined reference to 'usb_create'
/home/android/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/pcap/libpcap-1.3.0/pcap-linux.o: in function pcap_create:jni/libpcap-1.3.0/pcap-linux.c:446: error: undefined reference to 'nflog_create'
/home/android/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/pcap/libpcap-1.3.0/pcap-linux.o: in function pcap_platform_finddevs:jni/libpcap-1.3.0/pcap-linux.c:2301: error: undefined reference to 'usb_platform_finddevs'
/home/android/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/pcap/libpcap-1.3.0/pcap-linux.o: in function pcap_platform_finddevs:jni/libpcap-1.3.0/pcap-linux.c:2309: error: undefined reference to 'netfilter_platform_finddevs'
/home/android/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/pcap/libpcap-1.3.0/nametoaddr.o: in function pcap_ether_hostton:jni/libpcap-1.3.0/nametoaddr.c:483: error: undefined reference to 'ether_hostton'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libpcap.so] Error 1
===========================

The first one for example:
in function pcap_create:jni/libpcap-1.3.0/pcap-linux.c:434: error: undefined reference to 'can_create'

At the top of pcap-linux.c is the import for the header file:
#ifdef PCAP_SUPPORT_CAN
#include "pcap-can-linux.h"
#endif

Any ideas why are these functions not being found and therefore causing the build to fail?

Thanks,
Mike


Reply to this message