android ndk error "no such file or directory"? - android

I have some header files in include folder.
Here is the Android.mk file contents.
include $(call all-subdir-makefiles)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := fpdfembedsdk
LOCAL_SRC_FILES := FoxitEMBSDK_EMBJavaSupport.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_LDLIBS := -llog -g -L. -ljnigraphics
LOCAL_LDLIBS += libfpdfemb_android.a
include $(BUILD_SHARED_LIBRARY)
I am getting the following error.
$ /cygdrive/c/Android/android-ndk/ndk-build
Compile++ thumb : fpdfembedsdk <= FoxitEMBSDK_EMBJavaSupport.cpp
jni/FoxitEMBSDK_EMBJavaSupport.cpp:9:21: fatal error: fs_base.h: No such file or directory
compilation terminated.
/cygdrive/c/Android/android-ndk/build/core/build-binary.mk:255: recipe for target `obj/local/armeabi/objs/fpdfembedsdk/FoxitEMBSDK_EMBJavaSupport.o' failed
make: *** [obj/local/armeabi/objs/fpdfembedsdk/FoxitEMBSDK_EMBJavaSupport.o] Error 1
can anybody pls help me?

LOCAL_C_INCLUDES := $(LOCAL_PATH)
Check that. I guess you pass the wrong path. Are you sure all headers are there?

Related

Android.mk No rule to make target '*.c', needed by '*.o'. Stop

I have some problem.
I use ndk-build but I can't make library *.so.
--------------------------------- Error ---------------------------------
nathaniel#Nathaniel-MSI /work/workspace/HealthCare $ ndk-build
make: *** No rule to make target `jni/jni/src/filterData.c', needed by
`obj/local/armeabi/objs/HealthCare/jni/src/filterData.o'. Stop.
Under the my Android.mk source, help me please
--------------------------------- Android.mk ---------------------------------
LOCAL_PATH := $(call my-dir)
SRCS := $(wildcard $(LOCAL_PATH)/src/*.c)
include $(CLEAR_VARS)
LOCAL_MODULE := HealthCare
LOCAL_SRC_FILES := $(SRCS)
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES := $(SRCS:$(LOCAL_PATH)/%=%)
EDITED
LOCAL_C_INCLUDES := $(LOCAL_PATH)/src

Android OpenCV - "error: cannot find -lopencv_java"

I'm trying to develope a native code with OpenCV using IntelliJ IDEA 13.1.4. When I try to ndk-build the code provided in mixedprocessing sample, I have this error:
[armeabi-v7a] Compile++ thumb: com_sample_jniLib <= com_sample_jniLib.cpp
[armeabi-v7a] SharedLibrary : libcom_sample_jniLib.so
D:/Workspace/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -lopencv_java
make.exe: *** [obj/local/armeabi-v7a/libcom_voxar_tracker_TrackerLib.so] Error 1
D:\Workspace\android-ndk-r10\sources\cxx-stl\stlport\stlport
Basically, he can't find -lopencv_java.
Here is my Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include jni/opencv/OpenCV.mk
LOCAL_SRC_FILES := com_voxar_tracker_TrackerLib.cpp
LOCAL_MODULE := com_voxar_tracker_TrackerLib
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)
And my Application.mk:
APP_STL := stlport_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := all
As I told before, I'm using IntelliJ IDEA 13.1.4, OpenCV 2.4.9 and Android NDK r10 32-bit on Windows 8.1. Does anybody have any idea of what that could be?
You seem to have forgot OPENCV_INSTALL_MODULES:=on in your Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
include jni/opencv/OpenCV.mk
LOCAL_SRC_FILES := com_voxar_tracker_TrackerLib.cpp
LOCAL_MODULE := com_voxar_tracker_TrackerLib
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)

No rule to make target error android ndk build sqlite

I am trying to build sqlite using the android NDK to use a sqlite3_create_function but am getting No rule to make target error. make: *** No rule to make target '/fts3-rank.c', needed by '.../obj/local/armeabi/objs/fts3-rank//fts3-rank.o'. Stop. This Android.mk file is based off of the one on this website: http://www.roman10.net/how-to-compile-sqlite-for-android-using-ndk/
#LOCAL_PATH is used to locate source files in the development tree.
#the macro my-dir provided by the build system, indicates the path of the current directory
LOCAL_PATH := $(call my_dir)
#####################################################################
# build sqlite3 #
#####################################################################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/sqlite-amalgamation-3071700
LOCAL_MODULE := sqlite3
LOCAL_SRC_FILES := $(LOCAL_PATH)/sqlite-amalgamation-3071700/sqlite3.c
include $(BUILD_STATIC_LIBRARY)
#include $(BUILD_SHARED_LIBRARY)
#####################################################################
# build our code #
#####################################################################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/sqlite-amalgamation-3071700
LOCAL_MODULE := fts3-rank
LOCAL_SRC_FILES := fts3-rank.c
LOCAL_STATIC_LIBRARIES := libsqlite3
#LOCAL_SHARED_LIBRARIES:=libsqlite3
LOCAL_LDLIBS := -llog -lm
#include $(BUILD_SHARED_LIBRARY)
include $(BUILD_EXECUTABLE)
May be There some different reason of this error.
It may be LOCAL_PATH value incorrect so check LOCAL_PATH initialization. Remove any extra spaces in that.
LOCAL_PATH := $(call my-dir)__
Your jni library should be loaded in memory before calling any jni function. Load jni library as follow.
static {
System.loadLibrary("libmy-jni-module");
}
You may refer this discussion on so
I fixed it somehow by trial and error. It was very strange. I guess it's because I was using LOCAL_PATH twice?
I finally got it to build using this Android.mk
#LOCAL_PATH is used to locate source files in the development tree.
#the macro my-dir provided by the build system, indicates the path of the current directory
LOCAL_PATH := $(call my-dir)
#####################################################################
# build sqlite3 #
#####################################################################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := sqlite-amalgamation-3071700
LOCAL_MODULE := sqlite3
LOCAL_SRC_FILES := sqlite-amalgamation-3071700/sqlite3.c
include $(BUILD_STATIC_LIBRARY)
#include $(BUILD_SHARED_LIBRARY)
#####################################################################
# build our code #
#####################################################################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/sqlite-amalgamation-3071700
LOCAL_MODULE := fts3-rank
LOCAL_SRC_FILES := fts3-rank.c
LOCAL_STATIC_LIBRARIES := libsqlite3
#LOCAL_SHARED_LIBRARIES:=libsqlite3
LOCAL_LDLIBS := -llog -lm
include $(BUILD_SHARED_LIBRARY)
#need main function to have executable
#include $(BUILD_EXECUTABLE)

Android | fatal error: GLES/gl.h: No such file or directory

Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test
LOCAL_CFLAGS := -Wall
LOCAL_SRC_FILES := test.c
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM
include $(BUILD_SHARED_LIBRARY)
I run....
ndk-build NDK_PROJECT_PATH=./ APP_BUILD_SCRIPT=./Android.mk
and I get....
Compile thumb : test <= test.c
./test.c:8:29: fatal error: GLES/gl.h: No such file or directory
compilation terminated.
make: * [obj/local/armeabi/objs/test/test.o] Error 1
Now I am guessing adding a cflag of -I/include or a C_Include in the Android.mk will work but shouldn't that be handled by the -lGLESv1_CM.
Making an Application.mk file worked for me....
APP_ABI := armeabi armeabi-v7a
APP_PLATFORM := android-8

NDK build error

I am trying to use a pre built library within my project...its name is libfreeimage.so...
I am not able to build it properly using the NDK-build....
The error log has been pasted here...
please help me in this regard...
flock#QS57:~/Desktop/android-imagefilter-ndk$ /home/flock/ANDROID/android-ndk-r8/ndk-build
Prebuilt : libfreeimage.so <= jni/
Install : libfreeimage.so => libs/armeabi/libfreeimage.so
/home/flock/ANDROID/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-strip: Unable to recognise the format of the input file `./libs/armeabi/libfreeimage.so'
make: *** [libs/armeabi/libfreeimage.so] Error 1
make: *** Deleting file libs/armeabi/libfreeimage.so
flock#QS57:~/Desktop/android-imagefilter-ndk$
My android.mk file-
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libfreeimage
LOCAL_SRC_FILES := libfreeimage.a
include $(PREBUILT_SHARED_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := imageprocessing
LOCAL_SRC_FILES := imageprocessing.c
LOCAL_SHARED_LIBRARIES := libfreeimage
LOCAL_LDLIBS := -lm -llog -ljnigraphics
include $(BUILD_SHARED_LIBRARY)
You need to use
include ($BUILD_STATIC_LIBRARY)
instead of
include ($BUILD_SHARED_LIBRARY)
This will give you the desired .a file, not the .so.

Categories

Resources