Android ndk-r8 "error while trying to execute 'cc1plus': execvp: There is no such file or directory"

I am trying to use the Android NDK on Mountain Lion to create an Android library by following this tutorial

http://masl.cis.gvsu.edu/2012/01/25/android-echoprint/

When the time comes to compile the library, I run:

cd <path to jni>
<ndk>/ndk-build

I get the following error:

Compile++ thumb  : echoprint-jni <= AndroidCodegen.cpp
arm-linux-androideabi-g++: error trying to exec 'cc1plus': execvp: No such file or directory
make: *** [/Users/wingdom/Desktop/obj/local/armeabi/objs/echoprint-jni/AndroidCodegen.o] Error 1

I believe that I have added everything I need to the path variable:

export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:Developer/android-sdk/tools:/Developer/android-sdk/platform-tools:/Developer/android-ndk:/Developer/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin

What else do I need to do to compile this? I am using r8b NDK currently, but have tried it with versions up to 6.

EDIT:

I tried this solution: Error creating ndk android project

adding

export PATH=$PATH:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2

this error gets me to my path:

cc1plus: error: unrecognized command line option "-mbionic"
cc1plus: error: unrecognized command line option "-mthumb"
cc1plus: error: unrecognized command line option "-mfpu=vfp"
/Users/wingdom/Desktop/jni/AndroidCodegen.cpp:1: error: bad value (armv5te) for -march= switch
/Users/wingdom/Desktop/jni/AndroidCodegen.cpp:1: error: bad value (xscale) for -mtune= switch
make: *** [/Users/wingdom/Desktop/obj/local/armeabi/objs/echoprint-jni/AndroidCodegen.o] Error 1

but adding

export CROSS_COMPILER=$PATH:/Developer/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin

does not help, as in the link above.

+5
source
4

.
gcc, g++. , , .

, ndk , _ .. ( , toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/arm- linux-androideabi/bin, gcc_, g++_, c++_ gcc, g++, c++.)
Unarchiver NDK, , - unarchiving.

, NDK MD5, Mac .

.

+6

, / NDK. cc1plus, , $NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/libexec/gcc/arm-linux-androideabi/4.4.3/. , SDK / .

, V=1 ndk-build , - -B, . -B gcc, "" ( cc1plus - ). , r8 , , , - - . , ++ NDK :

 /opt/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi-v7a/objs/sometarget/SomeCppFile.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-exceptions -fno-rtti -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -I/opt/android-ndk/sources/cxx-stl/stlport/stlport -I/opt/android-ndk/sources/cxx-stl//gabi++/include -DANDROID -Wall -Wa,--noexecstack  -frtti  -O2 -DNDEBUG -g   -I/opt/android-ndk/platforms/android-8/arch-arm/usr/include -c  jni/SomeCppFile.cpp -o ./obj/local/armeabi-v7a/objs/sometarget/SomeCppFile.o
0

, g++:

$sudo apt-get install g++

0

,

arm-linux-androideabi-gcc: error trying to exec 'cc1': execvp: No such file... 

.

The problems were that I unpacked the NDK and SDK from 7z, which removed the executable permissions for all the binaries, and Eclipse was unable to run cc1. As soon as I unpacked the tar SDK and NDK files using tar, everything worked fine.

0
source

All Articles