I am trying to get access to gnuradio functions in Android, specifically the bandpass filter function. Without calling any functions, ndk-build compiles the code. When I call the complex_band_pass(...) function, it gives me an error of undefined reference to:
Error from ndk-build:
error: undefined reference to 'gr_firdes::complex_band_pass(double, double, double, double, double, gr_firdes::win_type, double)' collect2: ld returned 1 exit status
in my Android.mk file for this particular file:
include $(CLEAR_VARS)
LOCAL_MODULE := rxfilter
LOCAL_SRC_FILES := src/rx_filter.cpp
LOCAL_C_INCLUDES += /usr/local/include/gnuradio \
/usr/local/include \
${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/stlport
LOCAL_CFLAGS := -DANDROID -DUSE_LIBLOG
LOCAL_SHARED_LIBRARIES += rtlsdr
LOCAL_STATIC_LIBRARIES := /usr/local/lib/libgnuradio #doesn't seem to help
LOCAL_LDLIBS += -llog
include $(BUILD_SHARED_LIBRARY)
in my rx_filter.cpp file:
#include <jni.h>
#include <cmath>
#include <math.h>
#include <vector>
#include <gr_firdes.h>
using namespace std;
static void attemptToAccessGnuRadio()
{
// gr_firdes is a class
gr_firdes gg;
// compiles without this line
gg.complex_band_pass(1.0, 24000.0, 100.0, 500.0, 1.0);
}
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT jint JNICALL Java_rtlsdr_MainActivity_nativeRtlSdrFm(JNIEnv *envp, jobject objp)
{
return 1;
}
#ifdef __cplusplus
}
#endif
Note: gnuradio has been installed in the default location
What can I do to get access to gnuradio functions in android?
An alternative question would be how do I create a bandpass filter in Android NDK environment?
Thanks in advance, in the meantime I will be troubleshooting it myself as I have for the past few days. If I find the solution, I will post it.