Hi,
The following program works fine on Android 1.5 & 1.6, however, it
doesn't work on Android 2.0.
Can anyone help to explain what this error message means and how to
fix it?
# link_image[1831]: 613 could not load needed library 'libhello.so'
for '/system/xbin/test' (reloc_library[1245]: 613 cannot locate
'sys_malloc'...)CANNOT LINK EXECUTABLE
libhello.so:
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 extern void *sys_malloc(int size);
5 extern void sys_free(void* ptr);
6 int hello_world()
7 {
8 char *ptr = (char*)sys_malloc(10);
9 printf("%s: %p\n", __func__, ptr);
10 sys_free(ptr);
11 printf("%s: end\n", __func__);
12 return 0;
13 }
test:
1 #include <stdio.h>
2 #include <stdlib.h>
3 void *sys_malloc(int size) {return malloc(size);}
4 void sys_free(void* ptr) {free(ptr);}
5 int main (int argc, char **argv)
6 {
7 extern int hello_world(void);
8 hello_world();
9 }
Thank you in advance.
Mike
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en