On Mon, Jun 2, 2008 at 5:29 PM, David Given <[EMAIL PROTECTED]> wrote:

> >>Ashutosh wrote:
> >>[...]
> > INFO/dalvikvm(1185): Unable to dlopen(/system/lib/libNativeCpp.so):
> > Cannot find library
>
> >>This error usually shows up for unresolved symbols.
>

David Given wrote:

> >>[...]
> > System.loadLibrary("NativeC");
> > System.loadLibrary("NativeAdd");
>
> >>It's entirely possible that System.loadLibrary() doesn't allow libraries
> >>to see symbols defined in other libraries, so you won't be able to have
> >>NativeAdd depend on NativeC. However, I suspect your main problem is...
>

 I tried to change the order of loading library (i.e. loading NativeAdd
first and NativeC later, but android failed to load NativeAdd library,
probably because it was not able to resolve symbol ret_mul .

 David Given wrote:

> >>[...]
> > #include <iostream>
>
> >>iostream could well be trying to pull in symbols that the very
> >>stripped-down libc supported by the dalvik executable won't have.
>

Removing iostream and using 'extern "C"' made the library which has only one
undefined symbol '__aeabi_unwind_cpp_pr0' which is available in /system/lib


arm-none-linux-gnueabi-nm libNativeCpp.so
0000029c a _DYNAMIC
000002f4 a _GLOBAL_OFFSET_TABLE_
         U __aeabi_unwind_cpp_pr0
00000300 A __bss_end__
00000300 A __bss_start
00000300 A __bss_start__
00000300 D __data_start
00000300 A __end__
0000029c A __exidx_end
00000294 A __exidx_start
00000300 A _bss_end__
00000300 A _edata
00000300 A _end
00000260 T ret_mul_cpp

Thanks for the help.

But does this mean that all that big chunk of C and C++ source code that I
wanted to port to android will not be possible ?

I think Diluka had also experience problem porting his C/C++ code to
android.

Diluka, would you please comment on this. Could you port all your C/C++
source code to android? If yes could please give some points which I need to
take care while porting my C/C++ source code?

Thanks
Ashutosh




> --
> ┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
> │ "I have always wished for my computer to be as easy to use as my
> │ telephone; my wish has come true because I can no longer figure out
> │ how to use my telephone." --- Bjarne Stroustrup
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Internals" 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-internals?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to