Reputation: 324
Im trying to build android NDK and it gives me this error. Im using eclipse. Im using android-ndk-r12. and the Android NDK Preference in eclipse is C:\android-ndk-r12 (I have tried "C:\android-ndk-r12\build" too and it did not work). And the android Android.mk is as below:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := com_example_ndktest_Store
LOCAL_SRC_FILES := com_example_ndktest_Store.cpp
include $(BUILD_SHARED_LIBRARY)
The error is as below:
[armeabi-v7a] "Compile++ arm ": "com_example_ndktesting_Store <= com_example_ndktesting_Store.cpp"
process_begin: CreateProcess(NULL, C:/android-ndk-r12/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -MMD -MP -MF ./obj/local/armeabi-v7a/objs/com_example_ndktesting_Store/com_example_ndktesting_Store.o.d -gcc-toolchain C:/android-ndk-r12/build//../toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -g -target armv7-none-linux-androideabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -marm -O2 -DNDEBUG -IC:/android-ndk-r12/build//../sources/cxx-stl/gnu-libstdc++/4.9/include -IC:/android-ndk-r12/build//../sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -IC:/android-ndk-r12/build//../sources/cxx-stl/gnu-libstdc++/4.9/include/backward -Ijni -DANDROID -mfpu=vfp -mfloat-abi=softfp -fno-short-enums -Werror -DANDROID -DDISABLE_IMPORTGL -isystem /usr/include/ -Wa,--noexecstack -Wformat -Werror=format-security -std=gnu++0x -frtti -fexceptions -DANDROID -isystem C:/android-ndk-r12/build//../platforms/android-24/arch-arm/usr/include -c jni/com_example_ndktesting_Store.cpp -o ./obj/local/armeabi-v7a/objs/com_example_ndktesting_Store/com_example_ndktesting_Store.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [obj/local/armeabi-v7a/objs/com_example_ndktesting_Store/com_example_ndktesting_Store.o] Error 2
Upvotes: 1
Views: 2277
Reputation: 536
The NDK package you downloaded may have wrong folder name within the llvm toolchain.
Take a look at this path C:/android-ndk-r12/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe...In my case, the folder was windows, I renamed it to match windows-x86_64 and it worked.
Upvotes: 0
Reputation: 107
1- Make Sure you have the right version of NDK : If you use 32bit Windows, you should download and install android-ndk-r12-windows-x86.zip and if you use 64bit Windows, you should download and install android-ndk-r12-windows-x86_64.zip
2- Define proper toolchain: are you sure clang++.exe is found in the specified path , dose this ndk version has this toolchain? try to set NDK_TOOLCHAIN_VERSION (example NDK_TOOLCHAIN_VERSION := clang3.3) in Android.mk file to the proper toolchain found in ndk-r12. Android developers documentation:
NDK_TOOLCHAIN_VERSION
Define this variable as either 4.9 or 4.8 to select a version of the GCC compiler. Version 4.9 is the default for 64-bit ABIs, and 4.8 is the default for 32-bit ABIs. To select a version of Clang, define this variable as clang3.4, clang3.5, or clang. Specifying clang chooses the most recent version of Clang.
Upvotes: 3