更新:我注意到,控制檯輸出是給我:錯誤建設有NDK Android項目:在通用ELF重定位(EM:40)
Error while executing 'C:\Users\bowli\Tools\Android\android-ndk\android-ndk-r8e\ndk-build.cmd' with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\bowli\Documents\Projects\AndroidStudioProjects\CDP_AR1\app\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\Users\bowli\Documents\Projects\AndroidStudioProjects\CDP_AR1\app\src\main\jni\Application.mk APP_ABI=mips NDK_ALL_ABIS=mips NDEBUG=1 APP_PLATFORM=android-14 NDK_OUT=C:/Users/bowli/Documents/Projects/AndroidStudioProjects/CDP_AR1/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\bowli\Documents\Projects\AndroidStudioProjects\CDP_AR1\app\build\intermediates\ndkBuild\debug\lib C:/Users/bowli/Documents/Projects/AndroidStudioProjects/CDP_AR1/app/build/intermediates/ndkBuild/debug/obj/local/mips/libcdpp_jni.so}
通知
APP_ABI=mips NDK_ALL_ABIS=mips
它出現Android.mk和Application.mk的值在某處被覆蓋。現在我要試着找出它發生的地方。
BASE問題:
我嘗試建立與所提供的本地庫的Android應用程序:升壓,MetaIO等的應用程序是全功能的,我應該只是一個新的功能添加到它。然而,當我試圖建立它,我得到以下錯誤:
Error:process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
C:/Users/bowli/Tools/Android/android-ndk/android-ndk-r8e/toolchains/mipsel-linux-android-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/mipsel-linux-android/4.6/../../../../mipsel-linux-android/bin/ld.exe: C:\Users\bowli\Tools\Android\android-ndk\android-ndk-r8e\sources/boost/android/lib/libboost_filesystem.a(path.o): Relocations in generic ELF (EM: 40)
C:/Users/bowli/Tools/Android/android-ndk/android-ndk-r8e/toolchains/mipsel-linux-android-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/mipsel-linux-android/4.6/../../../../mipsel-linux-android/bin/ld.exe: C:\Users\bowli\Tools\Android\android-ndk\android-ndk-r8e\sources/boost/android/lib/libboost_filesystem.a(path.o): Relocations in generic ELF (EM: 40)
*the same line over9000 times (around 40 actually)*
C:/Users/bowli/Tools/Android/android-ndk/android-ndk-r8e/toolchains/mipsel-linux-android-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/mipsel-linux-android/4.6/../../../../mipsel-linux-android/bin/ld.exe: C:\Users\bowli\Tools\Android\android-ndk\android-ndk-r8e\sources/boost/android/lib/libboost_filesystem.a(path.o): Relocations in generic ELF (EM: 40)
C:\Users\bowli\Tools\Android\android-ndk\android-ndk-r8e\sources/boost/android/lib/libboost_filesystem.a: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [C:/Users/bowli/Documents/Projects/AndroidStudioProjects/CDP_AR1/app/build/intermediates/ndkBuild/debug/obj/local/mips/libcdpp_jni.so] Error 1
我絕不是與本地開發和配置這方面的專家,但是在網上衝浪導致我這個結論是boost並沒有爲我正在編譯的相同體系結構編譯。因此,我嘗試了所有更改Application.mk中的ABI來找出boost目標體系結構。我嘗試了支持的ABI列表(https://developer.android.com/ndk/guides/abis.html)中的所有ABI,並且都產生相同的錯誤。
然後我試圖更改一個專門對ARMv7(https://github.com/emileb/Boost-for-Android-Prebuilt)編譯給定的Boost庫,但是這給了我本質上是相同的錯誤:
C:/Users/bowli/Tools/Android/android-ndk/android-ndk-r8e/toolchains/mipsel-linux-android-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/mipsel-linux-android/4.6/../../../../mipsel-linux-android/bin/ld.exe: C:\Users\bowli\Tools\Android\android-ndk\android-ndk-r8e\sources/boost/armeabi-v7a/lib/libboost_filesystem-gcc-mt-1_53.a(path.o): Relocations in generic ELF (EM: 40)
C:\Users\bowli\Tools\Android\android-ndk\android-ndk-r8e\sources/boost/armeabi-v7a/lib/libboost_filesystem-gcc-mt-1_53.a: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [C:/Users/bowli/Documents/Projects/AndroidStudioProjects/CDP_AR1/app/build/intermediates/ndkBuild/debug/obj/local/mips/libcdpp_jni.so] Error 1
我Application.mk :
APP_ABI := armeabi-v7a
APP_STL := gnustl_static
APP_CPPFLAGS := -fexceptions
APP_CPPFLAGS += -fpermissive
APP_CPPFLAGS += -frtti
另外我不得不指定:
TARGET_ARCH_ABI := armeabi-v7a
在我的Android.mk中,否則它想爲某些原因建立mips。