Problem with linking libsupc++.a

1,358 views
Skip to first unread message

boiler

unread,
Dec 3, 2011, 8:47:49 AM12/3/11
to android-ndk
Hi Everyone,

i've a problem with the linker, here is the complete error message:

SharedLibrary : libndkfoo.so
arm-linux-androideabi-g++.exe: /cygdrive/c/Android/android-ndk/sources/
cxx-stl/gnu-libstdc++/libs/armeabi/libsupc++.a: No such file or
directory

The interesting thing is, that libsupc++.a is in the folder!

Why can't the linker find this file?

I'm using the Android 3.0 (API 11) on Windows 7 with cygwin. I'm using
a different project setup than the recommended setup, because i'm
porting a existing project to Android.

I hope someone can give a hint why the linker cannot find the file.

Thank you in advance.
Regards Mario

David Turner

unread,
Dec 3, 2011, 3:33:45 PM12/3/11
to andro...@googlegroups.com
On Sat, Dec 3, 2011 at 2:47 PM, boiler <www.derf...@gmx.de> wrote:
Hi Everyone,

i've a problem with the linker, here is the complete error message:

SharedLibrary  : libndkfoo.so
arm-linux-androideabi-g++.exe: /cygdrive/c/Android/android-ndk/sources/
cxx-stl/gnu-libstdc++/libs/armeabi/libsupc++.a: No such file or
directory

The interesting thing is, that libsupc++.a is in the folder!

Why can't the linker find this file?

It's a bug in the gnustl_shared module declaration. Sorry about that, it will be fixed in the next release.
In the meantime, you can manually change $NDK/sources/cxx-stl/gnu-libstdc++/Android.mk and replace the line that says:

LOCAL_EXPORT_LDLIBS := $(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/libsupc++.a

with:

LOCAL_EXPORT_LDLIBS := $(call host-path,$(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/libsupc++.a)

That should fix it.

- David
 
I'm using the Android 3.0 (API 11) on Windows 7 with cygwin. I'm using
a different project setup than the recommended setup, because i'm
porting a existing project to Android.

I hope someone can give a hint why the linker cannot find the file.

Thank you in advance.
Regards Mario

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
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.


boiler

unread,
Dec 4, 2011, 8:59:10 AM12/4/11
to android-ndk
> LOCAL_EXPORT_LDLIBS := $(call
> host-path,$(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/libsupc++.a)
>
> That should fix it.

Hi David,

thank for your reply.

Unfortunately, the problem is not solved. Do have an another idea what
i can do?

Regards Mario

Josh A

unread,
Dec 7, 2011, 4:58:39 PM12/7/11
to android-ndk
I am having the same problem. I had to downgrade to r6 to build my
project. Perhaps it is worth noting that my project was developed
using r6, and it broke when I upgraded.

- Josh

David Turner

unread,
Dec 14, 2011, 6:48:22 AM12/14/11
to andro...@googlegroups.com
Yes, I could reproduce this and the fix should be on the AOSP server right now.
Another host-path call was missing in build/core/build-binary.mk, you will need to change the line that reads:

      LOCAL_LDLIBS := $(LOCAL_LDLIBS) $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/$(TARGET_ARCH_ABI)/libsupc++.a

into:

      LOCAL_LDLIBS := $(LOCAL_LDLIBS) $(call host-path,$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/$(TARGET_ARCH_ABI)/libsupc++.a)

Hope this helps
Reply all
Reply to author
Forward
0 new messages