4

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
Community
  • 1
  • 1
Suman
  • 4,221
  • 7
  • 44
  • 64
  • 2
    "See 'config.log' for more details." That's the log file you should be looking at. – Mat Oct 11 '12 at 10:42
  • @Mat: I was looking config.log file only. It was a typo :). Thanks, i changed now as Config.log in the above msg. – Suman Oct 11 '12 at 10:47
  • 1
    Technically, the **./configure** script is right: your cross compiler cannot create executables that will run on Windows (or desktop Linux, for that matter). Sometimes, **./configure** can be _configured_ to understand that you are using cross-compiler, and do not intend to launch the binaries in the same environment where you perform your build. But I am not sure that unit test framework can be used in such scenario. To analyze the particular case, it could be useful if you publish which project you are trying to build (URL, version, etc. would be helpful). – Alex Cohn Oct 11 '12 at 14:13

2 Answers2

2

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  "
kartikg3
  • 2,590
  • 1
  • 16
  • 23
Sajan Jose
  • 21
  • 2
0

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

Anja V.
  • 115
  • 1
  • 1
  • 12