I'm trying to compile vlc using the following instructions http://wiki.videolan.org/AndroidCompile.
i get the vlc source using git but when i'm doing the next command:
cd extras/contrib
./bootstrap -t arm-eabi -d android
i'm getting this error:
[contrib] No install dir specified, using '/android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi'
[contrib] *****************************************************************
[contrib] * If you need contribs with all debug information, run this *
[contrib] * line and compile the libraries on your own. *
[contrib] * CONTRIBS_RELEASE=no ./bootstrap *
[contrib] *****************************************************************
[contrib] Using 1 processor(s)
when i make the next step that is 'make' i got the following failure;
make -C build-src tools
make[1]: Nothing to be done for `tools'.
make -C build-src
(cd zlib; CC="arm-linux-androideabi-gcc --sysroot=/android-ndk-r5b//platforms/android-9/arch-arm" CXX="arm-linux-androideabi-g++ --sysroot=/android-ndk-r5b//platforms/android-9/arch-arm" LD="arm-linux-androideabi-ld" RANLIB="arm-linux-androideabi-ranlib" AR="arm-linux-androideabi-ar" STRIP="arm-linux-androideabi-strip" ./configure --prefix=/android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi --static && make install)
Building static library libz.a version 1.2.5 with arm-linux-androideabi-gcc --sysroot=/android-ndk-r5b//platforms/android-9/arch-arm.
Checking for off64_t... No.
Checking for fseeko... No.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf().
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
arm-linux-androideabi-gcc --sysroot=/android-ndk-r5b//platforms/android-9/arch-arm -I/android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi/include -DNDEBUG -D__STDC_VERSION__=199901L -I/android-ndk-r5b//sources/cxx-stl/gnu-libstdc++/include -I/android-ndk-r5b//sources/cxx-stl/gnu-libstdc++/libs/armeabi/include -isystem /android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi/include -I/android-ndk-r5b//platforms/android-9/arch-arm/usr/include -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void -I/android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi/include -DNDEBUG -D__STDC_VERSION__=199901L -I/android-ndk-r5b//sources/cxx-stl/gnu-libstdc++/include -I/android-ndk-r5b//sources/cxx-stl/gnu-libstdc++/libs/armeabi/include -isystem /android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi/include -I/android-ndk-r5b//platforms/android-9/arch-arm/usr/include -c -o adler32.o adler32.c
make[2]: arm-linux-androideabi-gcc: No such file or directory
make[2]: *** [adler32.o] Error 1
make[1]: *** [.zlib] Error 2
make: *** [using-src] Error 2
anyone can help? i'm using mac OS X 10.6.6
tnx
Given prior Linux CLI experience, the best I can tell you is that it doesn't look like your tool-chain is fully initialized and needs some setup. Below is a link that documents initialization for a MAC build environment:
http://source.android.com/source/initializing.html
You probably should have set your NDK installation properly.
Download the latest Android NDK.
Unzip and move the extracted “android-ndk-r6″ directory to “/Applications”, so you end up with “/Applications/android-ndk-r6″.
Edit “~/.profile” to add the following:
export ANDROID_NDK=/Applications/android-ndk-r5b
export PATH=$PATH:$ANDROID_NDK:$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin
The PATH was the key to solve this kind of problem to me. Because it makes possible to find and use "arm-linux-androideabi-gcc".
Refer to this web site.
http://www.doitscared.com/632/eclipse-indigo-for-android-development-on-mac-os-x-snow-leopard/
Related
I wanted to examine the issue from this question: Android NDK for x86_64 has no reference for bcopy and index. In the question, the poster asked about Android x86_64 and bcopy in relation to the Lame sound library.
I set up my cross-compile environment, set the paths for tools and sysroot, and exported the usual suspects like CC, CXX CFLAGS, CXXFLAGS, etc. For example:
$ echo $CC
x86_64-linux-android-gcc
$ which x86_64-linux-android-gcc
/opt/android-ndk-r10d/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-gcc
And:
$ export CFLAGS="--sysroot=$ANDROID_SYSROOT"
$ echo $CFLAGS
--sysroot=/opt/android-ndk-r10d/platforms/android-21/arch-x86_64
The above is usually enough to get things started. Everything is set correctly, and I can use the script to build other libraries, like Crypto++ and OpenSSL (with some minor adjustments).
However, I have not been able to configure for Android x86_64 (see below). I can't seem to find the right triplet.
What triplet does Android x86_64 use with Autoconf?
Under Autoconf, AC's "build" is what most people consider "host", and AC's "host" is what most people consider "target". So the options are actually correct when cross compiling.
$ ./configure --build=`./config.guess` --host=x86_64-linux-androideabi
checking build system type... i686-apple-darwin12.5.0
checking host system type... Invalid configuration
`x86_64-linux-androideabi': system `androideabi' not recognized
configure: error: /bin/sh ./config.sub x86_64-linux-androideabi failed
$ ./configure --build=`./config.guess` --host=x86_64-linux-android
checking build system type... i686-apple-darwin12.5.0
checking host system type... Invalid configuration
`x86_64-linux-android': system `android' not recognized
configure: error: /bin/sh ./config.sub x86_64-linux-android failed
$ ./configure --build=`./config.guess`
checking build system type... i686-apple-darwin12.5.0
checking host system type... i686-apple-darwin12.5.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... x86_64-linux-android-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in
`/Users/android/lame-3.99.5':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
I fetched autoconf-2.69.tar.xz from the GNU FTP site. I found the latest config.guess and config.sub in the build-aux directory and used it for the LAME MP3 encoder project.
It appears the triplet is x86_64-linux-android.
The project has a broken link though. The invocation of the compiler driver through libtool that creates the shared object lacks CFLAGS, so --sysroot is not passed to the linker. That causes a bunch of link errors due to missing system libraries, like crtbegin_so.o, crtend_so.o, -lc and -ldl.
The fix for that is to manually run the the failed command from the libmp3lame directory. Prepend the command with $CC $CFLAGS <rest of project's command>.
I have followed all the steps written in the pjsip-startup guide.
But the last step (make dep && make clean && make) is giving me the following errors. I am on Windows 7.
$ make dep && make clean && make
for dir in pjlib/build pjlib-util/build pjnath/build third_party/build pjmedia/b uild pjsip/build pjsip-apps/build ; do \
if make -C $dir dep; then \
true; \
else \
exit 1; \
fi; \
done
make[1]: Entering directory '/cygdrive/d/android/pjproject-2.2.1/pjlib/build'
make -f /cygdrive/d/android/pjproject-2.2.1/build/rules.mak APP=PJLIB app=pjlib depend
make[2]: Entering directory '/cygdrive/d/android/pjproject-2.2.1/pjlib/build'
.pjlib-arm-unknown-linux-androideabi.depend:1: *** multiple target patterns. St op.
make[2]: Leaving directory '/cygdrive/d/android/pjproject-2.2.1/pjlib/build'
Makefile:88: recipe for target 'depend' failed
make[1]: *** [depend] Error 2
make[1]: Leaving directory '/cygdrive/d/android/pjproject-2.2.1/pjlib/build'
Makefile:14: recipe for target 'dep' failed
make: *** [dep] Error 1
Can someone help me to resolve these errors? Thanks!
After some research I come to know that don't use WINDOWS for building the PJSIP v2.x version. Now I am going to install Ubuntu on my system.
The build system is known to work on the following hosts:
Linux, many types of distributions.
MacOS X 10.2 mingw (Win2K, XP)
FreeBSD (must use gmake instead of make)
Building Win32 applications with Cygwin is currently not supported by the autoconf script (there are some conflicts with Windows headers), but one can still use the old configure script by calling ./configure-legacy. More over, cross-compilations might also work with Cygwin using this build system.
See the link for details.
I'm trying to compile GMP for android (arm) but I'm received a very strange error. First, I set up a few things as described another SO question here:
export NDKROOT=/prod/ndk
$NDKROOT/build/tools/make-standalone-toolchain.sh --platform=android-9 -- install-dir=$NDKROOT/android_armeabi
export CC="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-gcc --sysroot=$NDKROOT/android_armeabi/sysroot"
export CXX="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-g++ --sysroot=$NDKROOT/android_armeabi/sysroot"
export AR="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-ar"
export SYSROOT="$NDKROOT/android_armeabi/sysroot"
export PATH="$NDKROOT/android_armeabi/bin":$PATH
Then I simply run ./configure --enable-cxx --prefix=/local/to/where/i/want/to/install --host=arm-none-linux-gnueabi and configuration goes well, with the following being part of the output:
Version: GNU MP 5.1.1
Host type: arm-none-linux-gnueabi
ABI: standard
Install prefix: /location/to/where/i/want/to/install
Compiler: /prod/ndk/android_armeabi/bin/arm-linux-androideabi-gcc -- sysroot=/prod/ndk/android_armeabi/sysroot -std=gnu99
Static libraries: yes
Shared libraries: yes
Up to here it goes well, but when I run make, I receive the following error:
ismpf.cc: In function 'std::istream& operator>>(std::istream&, mpf_ptr)':
ismpf.cc:48:43: error: 'struct lconv' has no member named 'decimal_point'
make[2]: *** [ismpf.lo] Error 1
make[2]: Leaving directory `~/Downloads/gmp-5.1.1/cxx'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `~/Downloads/gmp-5.1.1'
make: *** [all] Error 2
So my first problem is there. Any ideas?
Just out of curiosity, I tried to rerun the same exact configure command as above but using sudo ahead of it. After a few seconds I receive the following:
configure: error: Oops, mp_limb_t is 64 bits, but the assembler code
in this configuration expects 32 bits.
There is the second (and really weird problem that arises).
Just out of curiosity again, I tried to reboot and clear all the variables we created, and simply run the command that the GMP manual recommends:
./configure --prefix=/location/ --enable-cxx --host=arm-linux-androideabi
The ./configure runs, the make goes well, but all 9/9 tests fail when I do make check. Can anybody point me in the right direction with these errors, or about how to try and correctly compile GMP for android? Any help is immensely appreciated.
Unsetting the CFLAGS env var solved the problem for me.
i have downloaded the latest android ndk r8b on my ubuntu 12.10 beta 2 .
i have included the ndk directory in the PATH variable (when i write ndk-b in terminal and hit tab it auto-completes it) .
but when i try :
cd android-ndk/samples/san-angeles/jni
ndk-build
i get this error:
make: /home/mixpro/Android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
make: /home/mixpro/Android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
Compile thumb : sanangeles <= importgl.c
make: /home/mixpro/Android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
make: *** [/home/mixpro/Android/android-ndk/samples/san-angeles/obj/local/armeabi/objs/sanangeles/importgl.o] Error 127
when checking the /android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin directory using ls i get:
arm-linux-androideabi-addr2line arm-linux-androideabi-g++
arm-linux-androideabi-gdbtui arm-linux-androideabi-size
arm-linux-androideabi-c++filt arm-linux-androideabi-gcc-4.6.x-google
arm-linux-androideabi-gprof arm-linux-androideabi-strings
arm-linux-androideabi-cpp arm-linux-androideabi-gcov
arm-linux-androideabi-readelf arm-linux-androideabi-elfedit
arm-linux-androideabi-gdb arm-linux-androideabi-run
meaning there is no arm-linux-androideabi-gcc in the directory
I am afraid that somehow you got arm-linux-androideabi-addr2line arm-linux-androideabi-gcc deleted. On linux, it is just a symlink to arm-linux-androideabi-gcc-4.6.x-google, so it's very easy to restore it. But maybe, to be on the safe side, it's worthwhile to reinstall NDK.
you should create symbolic link like this : ln -s /usr/bin/arm-linux-gnueabi-gcc-4.7 "/home/sofien/Bureau/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc"
I have downloaded the CPP Unit Test framework and trying to compile for the Android. But, facing the Configure issues. I tried making Standalone tool chain and also tried configuring but its always failing
sh-4.1$ ./configure CXX=arm-linux-androideabi-g++ CC=arm-linux-androideabi-gcc CPP=arm-linux-androideabi-g++ CXXCPP=arm-linux-androideabi-g++
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... arm-linux-androideabi-gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
sh-4.1$ arm-linux-androideabi-g++
arm-linux-androideabi-g++.exe: fatal error: no input files
compilation terminated.
sh-4.1$
My build environment is NDKr8, Cygwin, Windows7-x64.
I tried going through the config.log and found that the error is
arm-linux-androideabi-gcc.exe: error: CreateProcess: No such file or directory
I tried for fixing the above error by cutting down the path length and so on. But still not able to resolve. Please let me know if anyone has resolved similar problem.
Just to add the information from the link http://curl.haxx.se/mail/lib-2012-08/0184.html
but facing same issue with out Cygwin as well.
D:\Test>arm-linux-androideabi-gcc Main.c
arm-linux-androideabi-gcc: error: CreateProcess: No such file or directory
D:\Test>
As you observer even in the windows prompt as well it is the same issue.
----- Edit 1 -----
I tried configuring on the Ubuntu 12.04 OS with the below line
./configure --host=arm CXX=arm-linux-androideabi-g++ CC=arm-linux-androideabi-gcc CPP=arm-linux-androideabi-g++ CXXCPP=arm-linux-androideabi-g++
But getting these errors
checking how to run the C preprocessor... arm-linux-androideabi-g++
configure: error: in `/mnt/hgfs/VMShare/gperftools-2.0_Android/gperftools-2.0':
configure: error: C preprocessor "arm-linux-androideabi-g++" fails sanity check
See `config.log' for more details.
But most of the times ARM android Gcc compiler is failing.
configure:4216: arm-linux-androideabi-gcc -qversion >&5
arm-linux-androideabi-gcc: error: unrecognized option '-qversion'
arm-linux-androideabi-gcc: fatal error: no input files
Give the correct path and environment.
Example setup:
export NDK=/develop/android/android-ndk-r9b
export SYSROOT=$NDK/platforms/android-18/arch-x86
export CC="$NDK/toolchains/x86-4.7/prebuilt/linux-x86/bin/i686-linux-android-gcc --sysroot=$SYSROOT"
export CFLAGS="--sysroot=$SYSROOT "
export LDFLAGS="--sysroot=$SYSROOT "
I don't have experience with your particular setup, but when I was getting this error, I fixed it by adding gcc's bin folder to the system path and additionally, there had to be a version of each executable without a prefix (for example g++.exe, ld.exe...) in the gcc's bin directory. This solved the issue for me. I also logged off/on after changing the path, but don't know if it's necessary.
I got the idea here:
http://forums.codeblocks.org/index.php?topic=18100.0