Re: undefined reference to `__android_log_print' ??

6,471 views
Skip to first unread message

Hitendrasinh Gohil

unread,
Aug 28, 2012, 4:00:29 AM8/28/12
to andro...@googlegroups.com
any help?

On Tue, Aug 28, 2012 at 12:25 AM, Hitendrasinh Gohil <hitendr...@gmail.com> wrote:
Hi,
I am just trying to build the foxit demo_view  in windows7 using cygwin.But i am getting the following error.
"undefined reference to `__android_log_print'
can anybody suggest me what can be a problem?
Here is my Android.mk
------------------------------------------------
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE    := fpdfembedsdk
LOCAL_SRC_FILES := FoxitEMBSDK_EMBJavaSupport.cpp
LOCAL_C_INCLUDES := $(NDK_APP_PROJECT_PATH)/include
LOCAL_LDLIBS := -llog -g -L. -ljnigraphics

#fill in the foxit library here
LOCAL_LDLIBS := $(NDK_APP_PROJECT_PATH)/bin/libfpdfemb_android.a

include $(BUILD_SHARED_LIBRARY)
-----------------------------------------------------------------------------

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/IND173bJym4J.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.



--
regards,
Hitendrasinh Gohil

Vaishali

unread,
Aug 28, 2012, 4:30:59 AM8/28/12
to andro...@googlegroups.com
Please include the header for this function which is
#include<android/log.h> in the corresponding file which gives the error.

Hitendrasinh Gohil

unread,
Aug 28, 2012, 5:45:51 AM8/28/12
to andro...@googlegroups.com
include header in Android.mk?
--
regards,
Hitendrasinh Gohil

Chen Yang

unread,
Aug 28, 2012, 5:54:50 AM8/28/12
to andro...@googlegroups.com

LOCAL_LDLIBS := -llog -g -L. -ljnigraphics

#fill in the foxit library here

LOCAL_LDLIBS := $(NDK_APP_PROJECT_PATH)/bin/libfpdfemb_android.a

Your later assignment := removed the -llog, add the -llog to the later LOCAL_LDLIBS
or change that to +=
--
Chen

Hitendrasinh Gohil

unread,
Aug 28, 2012, 6:04:21 AM8/28/12
to andro...@googlegroups.com
Hi chan thanks,

LOCAL_LDLIBS := -llog -g -L. -ljnigraphics

#fill in the foxit library here

LOCAL_LDLIBS += $(NDK_APP_PROJECT_PATH)/bin/libfpdfemb_android.a

this way?

Chen Yang

unread,
Aug 28, 2012, 6:10:16 AM8/28/12
to andro...@googlegroups.com
yes, please have a try.

Hitendrasinh Gohil

unread,
Aug 28, 2012, 1:13:54 PM8/28/12
to andro...@googlegroups.com
If i change it to  LOCAL_LDLIBS += $(NDK_APP_PROJECT_PATH)/bin/libfpdfemb_android.a  then i m getting the following exception.

$ /cygdrive/c/Android/android-ndk/ndk-build
Compile++ thumb  : fpdfembedsdk <= FoxitEMBSDK_EMBJavaSupport.cpp
In file included from jni/FoxitEMBSDK_EMBJavaSupport.h:2:0,
                 from jni/FoxitEMBSDK_EMBJavaSupport.cpp:22:
C:/Android/android-ndk/platforms/android-8/arch-arm/usr/include/jni.h:592:13: note: the mangling of 'va_list' has changed in GCC 4.4
jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function 'jint Java_FoxitEMBSDK_EMBJavaSupport_FSFileReadAlloc(JNIEnv*, jclass, jstring)':
jni/FoxitEMBSDK_EMBJavaSupport.cpp:1184:38: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function 'jint Java_FoxitEMBSDK_EMBJavaSupport_FSPauseHandlerAlloc(JNIEnv*, jclass)':
jni/FoxitEMBSDK_EMBJavaSupport.cpp:1218:38: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
SharedLibrary  : libfpdfembedsdk.so
arm-linux-androideabi-g++.exe: error: ./bin/libfpdfemb_android.a: No such file or directory
/cygdrive/c/Android/android-ndk/build/core/build-binary.mk:378: recipe for target `obj/local/armeabi/libfpdfembedsdk.so' failed
make: *** [obj/local/armeabi/libfpdfembedsdk.so] Error 1

can anybody pls point me what is the problem?

David Turner

unread,
Aug 28, 2012, 1:49:15 PM8/28/12
to andro...@googlegroups.com
That's normal, the libfpdfemb_android.a library wasn't there.
If this is prebuilt, why aren't you using PREBUILT_STATIC_LIBRARY instead? See $NDK/docs/PREBUILTS.html
If it is not a prebuilt, you need to use LOCAL_STATIC_LIBRARIES to indicate that you libfpdfembedsdk.so depends on it, otherwise the build system may try to build it before the static lib.

Hitendrasinh Gohil

unread,
Aug 28, 2012, 1:57:17 PM8/28/12
to andro...@googlegroups.com
Hey David you are right but after cleaning the project i forgot to p
ut the lib in bin directory.
Below thread has solved my problem.
Reply all
Reply to author
Forward
0 new messages