enabling logs in android_reboot.c

275 views
Skip to first unread message

sudhir

unread,
May 1, 2012, 10:18:02 AM5/1/12
to android-...@googlegroups.com
Hi

I want to debug android_reboot.c file by putting logs in system/core/libcutils/android_reboot.c

I have included <cutils/log.h> and used LOGD to log messages.

But while building i am always getting the following link error.

 undefined reference to '__android_log_print

I am not sure how to include the liblog in system/core/libcutils/ Android.mk .

Could anyone please help me in resolving this problem.

Thanks
Sudhir

Chris Stratton

unread,
May 1, 2012, 3:10:20 PM5/1/12
to android-platform
On May 1, 10:18 am, sudhir <sudhir...@gmail.com> wrote:
> But while building i am always getting the following link error.
>
>  undefined reference to '__android_log_print
>
> I am not sure how to include the liblog in
> system/core/libcutils/ Android.mk .

You should have something like -llog in the linker command that ends
up executed.

Fastest solution is probably to look for examples - ie grep -r the
tree for existing invocations of the log function in source, and then
check the makefile associated with that source.

dochuan

unread,
Nov 9, 2012, 2:28:48 AM11/9/12
to android-...@googlegroups.com
constructor cached in sConstructorMap, so when mContex changed
(classloader change),
constructor not updated follow

Himanshu Gusain

unread,
Mar 30, 2015, 6:34:20 PM3/30/15
to android-...@googlegroups.com
 
Boyan Vladinov Thanks for your inputs it resolved my problem

On Thursday, November 8, 2012 at 6:44:30 AM UTC-6, Boyan Vladinov wrote:
Try to compile only libcutils project and sync with Android device.

The reason why you could not compile libcutils with included cutils/log.h and call to LOGD is because __android_log_print is included in liblog.so, but liblog.so is compiled after the compileation of libcutils.
Reply all
Reply to author
Forward
0 new messages