Configure: error: C compiler cannot create executable files when configuring for Android

I downloaded the CPP Unit Test framework and tried to compile for Android. But faced with tuning problems. I tried to make a standalone tool chain , and also tried to set up, but always failed

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 config.log and found that the error

 arm-linux-androideabi-gcc.exe: error: CreateProcess: No such file or directory 

I tried to fix the above error by shortening the path length and so on. But still not able to resolve. Please let me know if anyone has resolved a similar problem.

Just add the information from the link http://curl.haxx.se/mail/lib-2012-08-08/0184.html but you encounter the same problem with Cygwin.

 D:\Test>arm-linux-androideabi-gcc Main.c arm-linux-androideabi-gcc: error: CreateProcess: No such file or directory D:\Test> 

As you can see even at the Windows prompt, this is the same problem.

----- Edit 1 ----- I tried to configure on Ubuntu 12.04 OS using the following 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 time, the ARM android Gcc compiler fails.

 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 
+4
source share
2 answers

Specify the correct path and environment.

Setting example:

 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 " 
+1
source

I have no experience with your specific setup, but when I received this error, I fixed it by adding the gcc bin folder to the system path and, in addition, there should be a version of each executable without a prefix (for example, g ++. Exe, ld.exe ...) in the gcc bin directory. This solved the problem for me. I also logged out / after changing the path, but I don't know if this is necessary.

I got an idea: http://forums.codeblocks.org/index.php?topic=18100.0

0
source

Source: https://habr.com/ru/post/1439125/


All Articles