0

When I run the ndk-build on my project, I get the following error:

> Android NDK: WARNING: APP_PLATFORM android-21 is larger than
> android:minSdkVersion 15 in ./AndroidManifest.xml     [arm64-v8a]
> Compile        : pcap <= pcap-linux.c jni/libpcap/pcap-linux.c:118:0:
> warning: "_GNU_SOURCE" redefined  #define _GNU_SOURCE  ^
> <command-line>:0:0: note: this is the location of the previous
> definition [arm64-v8a] Compile        : pcap <= pcap-usb-linux.c
> [arm64-v8a] Compile        : pcap <= pcap-can-linux.c make: *** No
> rule to make target `jni/libpcap/pcap-netfilter-linux-android.c',
> needed by
> `obj/local/arm64-v8a/objs/pcap/pcap-netfilter-linux-android.o'.  Stop.

This is my Android.mk file for the libpcap

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

libpcap_PSRC = pcap-linux.c pcap-usb-linux.c  pcap-can-linux.c pcap-netfilter-linux-android.c pcap-netfilter-linux.c
libpcap_FSRC = fad-gifc.c
libpcap_CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c bpf_image.c bpf_dump.c
libpcap_GENSRC = scanner.c grammar.c bpf_filter.c version.c

libpcap_SRC = $(libpcap_PSRC) $(libpcap_FSRC) $(libpcap_CSRC) $(libpcap_GENSRC)

LOCAL_SRC_FILES:= $(libpcap_SRC)

LOCAL_CFLAGS:=-O2 -g -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -Dlinux -D__GLIBC__ -D_GNU_SOURCE

LOCAL_EXPORT_C_INCLUDE_DIRS:= $(LOCAL_PATH)

LOCAL_MODULE:= libpcap

include $(BUILD_STATIC_LIBRARY)

Looking at few other questions that was previous asked, I have removed any unnecessary spaces from the makefile and I have made sure to best of my knowledge that there is no error in the makefile either.

I am not sure what else is causing the issue. I am very new to NDK and in fact this is very basic hello world application that I am building to more about NDK and incorporating LIBPCAP in the project.

I am using libpcap version 1.5.2, NDK Version: r10e-rc4 (64 bit)

Help is appreciated.

1 Answers1

0

Figured this out... the cause of the error was my main Android.mk file was building an executable and my JNI code didn't have any main() function.