Re: Need help in compiling vlc for android

1,048 views
Skip to first unread message

Pablo Márquez

unread,
Jun 6, 2012, 5:29:05 AM6/6/12
to andro...@googlegroups.com
Hi Michael,

That library should be in the folder $(android-ndk-root)/<my_toolchain>/sysroot/usr/lib

Where <my_toolchain> is the folder you specified when you created the tootchain.

This is assuming you used the NDK's make-standalone-toolchain.sh script. If you didn't use this script, then you should probably add the path to your sysroot using -L gcc option.

Cheers,

C:\android\android-ndk\my_toolchain\sysroot\usr\lib

On Wed, Jun 6, 2012 at 12:12 AM, mike s <michael.j....@gmail.com> wrote:
Hi,

I have gotten the vlc source and tries to compile for android.
But i am getting this error:

android-ndk-r8/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libstdc++.a: No such file or directory

how can I get the libstdc++.a for ndk-r8?

jni/libvlcjni.c:620: warning: implicit declaration of function 'vlc_fourcc_GetDescription'
Compile thumb  : vlcjni <= aout.c
Compile thumb  : vlcjni <= thumbnailer.c
Compile thumb  : vlcjni <= pthread-condattr.c
Compile thumb  : vlcjni <= pthread-rwlocks.c
Compile thumb  : vlcjni <= eventfd.c
Compile thumb  : vlcjni <= sem.c
SharedLibrary  : libvlcjni.so
arm-linux-androideabi-g++: /home/mike/Programs/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libstdc++.a: No such file or directory
make[1]: *** [obj/local/armeabi-v7a/libvlcjni.so] Error 1
make[1]: Leaving directory `/home/cheungs/Src/vlc-android/vlc-android'
make: *** [vlc-android/obj/local/armeabi-v7a/libvlcjni.so] Error 2
rm android-libs/libmedia.c android-libs/libutils.c android-libs/libstagefright.c android-libs/libbinder.c

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



--
....:::::: ^__^ ::::::....

David Turner

unread,
Jun 6, 2012, 5:37:51 AM6/6/12
to andro...@googlegroups.com
This library should be libgnustl_static.a or libgnustl_shared.so instead. How are you specifying your dependency to the C++ library.
If you use APP_STL := gnustl_static or APP_STL := gnustl_shared, the problem should not appear.

Are you adding explicit paths like -L...../gnu-libstdc++/libs/$(TARGET_ARCH_ABI)/ -lstdc++ to your LDFLAGS somewhere?

mike s

unread,
Jun 6, 2012, 12:11:04 PM6/6/12
to andro...@googlegroups.com
Thank you. Gulfas,

I did not run the NDK's make-standalone-toolchain.sh script.
I ran it. And I see libstdc++.a but VLC is looking for 'sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libstdc++.a', which I still don' have.

how can I get the libstdc++.a which VLC is looking for?

$ ./build/tools/make-standalone-toolchain.sh
Auto-config: --toolchain=arm-linux-androideabi-4.4.3
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying libstdc++ headers and libraries...
Creating package file: /tmp/ndk-mikes/arm-linux-androideabi-4.4.3.tar.bz2
Cleaning up...
Done.

 $ find . -name libstdc++.a
./platforms/android-4/arch-arm/usr/lib/libstdc++.a
./platforms/android-9/arch-x86/usr/lib/libstdc++.a
./platforms/android-9/arch-arm/usr/lib/libstdc++.a
./platforms/android-9/arch-mips/usr/lib/libstdc++.a
./platforms/android-5/arch-arm/usr/lib/libstdc++.a
./platforms/android-8/arch-arm/usr/lib/libstdc++.a
./platforms/android-3/arch-arm/usr/lib/libstdc++.a
./platforms/android-14/arch-x86/usr/lib/libstdc++.a
./platforms/android-14/arch-arm/usr/lib/libstdc++.a
./platforms/android-14/arch-mips/usr/lib/libstdc++.a

SharedLibrary  : libvlcjni.so
arm-linux-androideabi-g++: /home/cheungs/Programs/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libstdc++.a: No such file or directory

make[1]: *** [obj/local/armeabi-v7a/libvlcjni.so] Error 1
make[1]: Leaving directory `/home/cheungs/Src/vlc-android/vlc-android'
make: *** [vlc-android/obj/local/armeabi-v7a/libvlcjni.so] Error 2
rm android-libs/libmedia.c android-libs/libutils.c android-libs/libstagefright.c android-libs/libbinder.c


On Wednesday, June 6, 2012 2:29:05 AM UTC-7, Gulfas wrote:
Hi Michael,

That library should be in the folder $(android-ndk-root)/<my_toolchain>/sysroot/usr/lib

Where <my_toolchain> is the folder you specified when you created the tootchain.

This is assuming you used the NDK's make-standalone-toolchain.sh script. If you didn't use this script, then you should probably add the path to your sysroot using -L gcc option.

Cheers,

C:\android\android-ndk\my_toolchain\sysroot\usr\lib

On Wed, Jun 6, 2012 at 12:12 AM, mike s <michael.j.silverstri@gmail.com> wrote:
Hi,

I have gotten the vlc source and tries to compile for android.
But i am getting this error:

android-ndk-r8/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libstdc++.a: No such file or directory

how can I get the libstdc++.a for ndk-r8?

jni/libvlcjni.c:620: warning: implicit declaration of function 'vlc_fourcc_GetDescription'
Compile thumb  : vlcjni <= aout.c
Compile thumb  : vlcjni <= thumbnailer.c
Compile thumb  : vlcjni <= pthread-condattr.c
Compile thumb  : vlcjni <= pthread-rwlocks.c
Compile thumb  : vlcjni <= eventfd.c
Compile thumb  : vlcjni <= sem.c
SharedLibrary  : libvlcjni.so
arm-linux-androideabi-g++: /home/mike/Programs/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libstdc++.a: No such file or directory
make[1]: *** [obj/local/armeabi-v7a/libvlcjni.so] Error 1
make[1]: Leaving directory `/home/cheungs/Src/vlc-android/vlc-android'
make: *** [vlc-android/obj/local/armeabi-v7a/libvlcjni.so] Error 2
rm android-libs/libmedia.c android-libs/libutils.c android-libs/libstagefright.c android-libs/libbinder.c


--
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/-/NeJ10JodITIJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.



--
....:::::: ^__^ ::::::....

Chris Stratton

unread,
Jun 6, 2012, 1:22:35 PM6/6/12
to android-ndk
On Jun 6, 12:11 pm, mike s <michael.j.silvers...@gmail.com> wrote:
>
> I did not run the NDK's make-standalone-toolchain.sh script.
> I ran it. And I see libstdc++.a but VLC is looking for
> 'sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libstdc++.a', which I still
> don' have.
>
> how can I get the libstdc++.a which VLC is looking for?

You don't. You fix VLC's config/build system to want the one you
have.

...or you make some ugly hack with symlinks.

David Turner

unread,
Jun 7, 2012, 3:50:19 AM6/7/12
to andro...@googlegroups.com
You should fix the VLC build system to look for libgnustl_static.a instead of libstdc++.a in this directory. They are the *same* files by the way (in NDK r8, we removed libstdc++.a to reduce duplicates).

Note that if you run make-standalone-toolchain.sh, the generated toolchain installation's libstdc++.a will be a copy of libgnustl_static.a (the shared version is still called libgnustl_shared.so though because you cannot 'simply' rename a shared library, blame the ELF format for not making this trivial).

I also note that you're calling make-standalone-toolchain.sh without any arguments. This means the script has simply created a tarball containing your toolchain (under /tmp/ndk-mikes/arm-linux-androideabi-4.4.3.tar.bz2). You need to unpack this toolchain somewhere and add its 'bin' directory to your path. Another alternative is to use the --install-dir=<path> option to avoid the packaging and do a straight install.
 
Finally, it looks like the VLC build is using ndk-build (given the SharedLibrary: / Compile thumb: / etc.. line output). The fix is probably very trivial to perform in one or two Android.mk files. Just grep for libstdc++.a to see where the library is explicitely referenced.

To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/pDXc2IhP9V4J.

To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

mike s

unread,
Jun 8, 2012, 5:16:33 PM6/8/12
to andro...@googlegroups.com
Thank you. I am using ndk 8.

I ran the script with an 'install-dir', but it only generates 'libstdc++.a' not 'libgnustl_static.a'.
So how can I get it to generate 'libgnustl_static.a' before I fix the VLC build system to look for libgnustl_static.a instead of libstdc++.a in this directory.' per your suggestion

$ ./build/tools/make-standalone-toolchain.sh --install-dir=/home/mikes/bin/androi-ndk/

Auto-config: --toolchain=arm-linux-androideabi-4.4.3
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying libstdc++ headers and libraries...
Copying files to: /home/mikes/bin/androi-ndk/
Cleaning up...
Done.

~/bin $ find . -name libgnustl_static.a
~/bin $ find . -name libstdc++.a
./androi-ndk/arm-linux-androideabi/lib/thumb/libstdc++.a
./androi-ndk/arm-linux-androideabi/lib/armv7-a/libstdc++.a
./androi-ndk/arm-linux-androideabi/lib/libstdc++.a
./androi-ndk/sysroot/usr/lib/libstdc++.a



On Thursday, June 7, 2012 12:50:19 AM UTC-7, Digit wrote:
Reply all
Reply to author
Forward
0 new messages