building android project produces make error 2

后端 未结 2 658
迷失自我
迷失自我 2020-12-20 19:27

I have recently purchased a book to assist in my development of C++ for Android which contained some code samples. However, when I come to build some of the sample code, I

相关标签:
2条回答
  • 2020-12-20 19:42

    Check your project path if is contain spaces and non-english characters.
    I moved my project into somewhere without spaces, re-build it and works.

    0 讨论(0)
  • 2020-12-20 19:54

    Android NDK r9 contains the following toolchains:

    1. arm-linux-androideabi-4.6
    2. arm-linux-androideabi-4.8
    3. arm-linux-androideabi-clang3.2
    4. arm-linux-androideabi-clang3.3
    5. llvm-3.2
    6. llvm-3.3
    7. mipsel-linux-android-4.6
    8. mipsel-linux-android-4.8
    9. mipsel-linux-android-clang3.2
    10. mipsel-linux-android-clang3.3
    11. x86-4.6
    12. x86-4.8
    13. x86-clang3.2
    14. x86-clang3.3

    There is no toolchain for gcc 4.7. However, your Application.mk contains the line:

    NDK_TOOLCHAIN_VERSION   := 4.7
    

    Which tells the NDK to look for the 4.7 toolchain. And it fails.

    So, the solution to your problem is changing the NDK_TOOLCHAIN_VERSION variable to 4.6, 4.8, clang3.2, clang3.3, or just clang (which will use the most recent version of Clang available in the NDK).

    0 讨论(0)
提交回复
热议问题