Re: NDK with stlport_shared for standalone binary?

841 views
Skip to first unread message

Andrew Hsieh

unread,
Jul 17, 2012, 4:54:09 PM7/17/12
to andro...@googlegroups.com
Do you have libs/*/libstlport_shared.so by any chances?

On Tue, Jul 17, 2012 at 12:30 PM, Ezekeel <notez...@googlemail.com> wrote:
I want to compile a standalone binary from C++ sources which use some basic STL stuff like string, vector and so on.

If I compile it with 'stlport_static' everything works fine.

However with 'stlport_shared' I get this error message when executing the binary on the device: link_image[1965]: 14649 could not load needed library 'libstlport_shared.so' for '/data/prog' (load_library[1120]: Library 'libstlport_shared.so' not found)CANNOT LINK EXECUTABLE

Any ideas?

--
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/-/9BLd1yb-3TkJ.
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.

Andrew Hsieh

unread,
Jul 17, 2012, 6:16:01 PM7/17/12
to andro...@googlegroups.com
NDK deliberately renames libstlport to libstlport_shared.so in order not to confuse with the device /system/lib/libstlport.so, which may or may not be built with the same header, API, etc.  Please stay with libstlport_shared.so for portability.  

Adding "V=1" you may see that ndk-build  

On Tue, Jul 17, 2012 at 2:12 PM, Ezekeel <notez...@googlemail.com> wrote:
Damn I must be blind.

I just realized that the stlport lib on my device in /system/lib is named 'libstlport.so' and not 'libstlport_shared.so' as expected by the linker.

I just tested it by copying the 'libstlport.so' to 'libstlport_shared.so' and now it works fine.

Any way to point the linker to use the 'libstlport.so'?

--
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/-/eYx5pyMNMT4J.

Andrew Hsieh

unread,
Jul 17, 2012, 7:19:30 PM7/17/12
to andro...@googlegroups.com
You need to do "adb pull /system/lib/libstlport.so" then do what APP_STL does (*1) w/o setting APP_STL := true.  Add your stlport header/lib path in LOCAL_CFLAGS and/or LOCAL_C_INCLUDES/LOCAL_LDLIBS in Android.mk

(*1)  Add "V=1" to ndk-build to see what happens under the hood 

On Tue, Jul 17, 2012 at 3:54 PM, Ezekeel <notez...@googlemail.com> wrote:
Yeah, but then I would have to include a copy of the libstlport_shared.so with my app.

Since I am interested in keeping the distribution small I want to use the /system/lib/libstlport.so. I understand that can lead to compatibility issues, but I willing to risk that.

So, any way to use the /system/lib/libstlport.so?

--
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/-/jzU5yW9X3-YJ.
Reply all
Reply to author
Forward
0 new messages