CMake configure for Android fails
up vote
0
down vote
favorite
I'm trying to compile a dynamic library for Android. I use CMake-gui on Windows to do it. I successfully built the library (TagLib) a few years ago. But now the toolchain doesn't work anymore.
If I try to point the android.toolchain.cmake script to NDK R18, it fails with this error message:
Android: Targeting API '22' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
CMake Error at C:/app/cmake/share/cmake-3.12/Modules/Platform/Android/Determine-Compiler-NDK.cmake:97 (message):
Android: No toolchain for ABI 'armeabi-v7a' found in the NDK:
I think it might be related to the fact that Android NDK now switched from GCC to Clang. So I tried an older NDK R16b. Now it gets a little bit further but still fails now with this error message:
CMake Error at C:/app/cmake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler
"c:/app/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp
Run Build Command:"C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe" "cmTC_9e009/fast"
C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe -f CMakeFilescmTC_9e009.dirbuild.make CMakeFiles/cmTC_9e009.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o
c:appandroid-ndk-r16btoolchainsarm-linux-androideabi-4.9prebuiltwindows-x86_64binarm-linux-androideabi-gcc.exe
-target armv7-none-linux-androideabi --sysroot=C:/app/android-ndk-r16b/platforms/android-22/arch-arm -isystem C:appandroid-ndk-r16bplatformsandroid-22arch-armusrinclude
-isystem C:appandroid-ndk-r16bplatformsandroid-22arch-armusrincludearm-linux-androideabi
-g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -fPIE -o CMakeFilescmTC_9e009.dirtestCCompiler.c.o -c C:MojeQtProjectstaglib_buildCMakeFilesCMakeTmptestCCompiler.c
arm-linux-androideabi-gcc.exe: error: armv7-none-linux-androideabi: No such file or directory
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-target'
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-fno-integrated-as'
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-fno-limit-debug-info'
CMakeFilescmTC_9e009.dirbuild.make:64: recipe for target 'CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_9e009/fast' failed
mingw32-make.exe: *** [cmTC_9e009/fast] Error 2
I don't understand what is wrong with the test command and why it fails. Do you have any idea?
And after all is my approach to build a dynamic Android library correct or are there better ways to do it? I don't use Android Studio, I develop my application in QtCreator.
add a comment |
up vote
0
down vote
favorite
I'm trying to compile a dynamic library for Android. I use CMake-gui on Windows to do it. I successfully built the library (TagLib) a few years ago. But now the toolchain doesn't work anymore.
If I try to point the android.toolchain.cmake script to NDK R18, it fails with this error message:
Android: Targeting API '22' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
CMake Error at C:/app/cmake/share/cmake-3.12/Modules/Platform/Android/Determine-Compiler-NDK.cmake:97 (message):
Android: No toolchain for ABI 'armeabi-v7a' found in the NDK:
I think it might be related to the fact that Android NDK now switched from GCC to Clang. So I tried an older NDK R16b. Now it gets a little bit further but still fails now with this error message:
CMake Error at C:/app/cmake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler
"c:/app/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp
Run Build Command:"C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe" "cmTC_9e009/fast"
C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe -f CMakeFilescmTC_9e009.dirbuild.make CMakeFiles/cmTC_9e009.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o
c:appandroid-ndk-r16btoolchainsarm-linux-androideabi-4.9prebuiltwindows-x86_64binarm-linux-androideabi-gcc.exe
-target armv7-none-linux-androideabi --sysroot=C:/app/android-ndk-r16b/platforms/android-22/arch-arm -isystem C:appandroid-ndk-r16bplatformsandroid-22arch-armusrinclude
-isystem C:appandroid-ndk-r16bplatformsandroid-22arch-armusrincludearm-linux-androideabi
-g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -fPIE -o CMakeFilescmTC_9e009.dirtestCCompiler.c.o -c C:MojeQtProjectstaglib_buildCMakeFilesCMakeTmptestCCompiler.c
arm-linux-androideabi-gcc.exe: error: armv7-none-linux-androideabi: No such file or directory
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-target'
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-fno-integrated-as'
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-fno-limit-debug-info'
CMakeFilescmTC_9e009.dirbuild.make:64: recipe for target 'CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_9e009/fast' failed
mingw32-make.exe: *** [cmTC_9e009/fast] Error 2
I don't understand what is wrong with the test command and why it fails. Do you have any idea?
And after all is my approach to build a dynamic Android library correct or are there better ways to do it? I don't use Android Studio, I develop my application in QtCreator.
Please, format build logs as a code (Ctrl+Kor{}button), not as a blockquote. The latter formatting doesn't preserve newlines; it is very difficult to read such logs.
– Tsyvarev
Nov 22 at 12:21
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to compile a dynamic library for Android. I use CMake-gui on Windows to do it. I successfully built the library (TagLib) a few years ago. But now the toolchain doesn't work anymore.
If I try to point the android.toolchain.cmake script to NDK R18, it fails with this error message:
Android: Targeting API '22' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
CMake Error at C:/app/cmake/share/cmake-3.12/Modules/Platform/Android/Determine-Compiler-NDK.cmake:97 (message):
Android: No toolchain for ABI 'armeabi-v7a' found in the NDK:
I think it might be related to the fact that Android NDK now switched from GCC to Clang. So I tried an older NDK R16b. Now it gets a little bit further but still fails now with this error message:
CMake Error at C:/app/cmake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler
"c:/app/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp
Run Build Command:"C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe" "cmTC_9e009/fast"
C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe -f CMakeFilescmTC_9e009.dirbuild.make CMakeFiles/cmTC_9e009.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o
c:appandroid-ndk-r16btoolchainsarm-linux-androideabi-4.9prebuiltwindows-x86_64binarm-linux-androideabi-gcc.exe
-target armv7-none-linux-androideabi --sysroot=C:/app/android-ndk-r16b/platforms/android-22/arch-arm -isystem C:appandroid-ndk-r16bplatformsandroid-22arch-armusrinclude
-isystem C:appandroid-ndk-r16bplatformsandroid-22arch-armusrincludearm-linux-androideabi
-g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -fPIE -o CMakeFilescmTC_9e009.dirtestCCompiler.c.o -c C:MojeQtProjectstaglib_buildCMakeFilesCMakeTmptestCCompiler.c
arm-linux-androideabi-gcc.exe: error: armv7-none-linux-androideabi: No such file or directory
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-target'
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-fno-integrated-as'
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-fno-limit-debug-info'
CMakeFilescmTC_9e009.dirbuild.make:64: recipe for target 'CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_9e009/fast' failed
mingw32-make.exe: *** [cmTC_9e009/fast] Error 2
I don't understand what is wrong with the test command and why it fails. Do you have any idea?
And after all is my approach to build a dynamic Android library correct or are there better ways to do it? I don't use Android Studio, I develop my application in QtCreator.
I'm trying to compile a dynamic library for Android. I use CMake-gui on Windows to do it. I successfully built the library (TagLib) a few years ago. But now the toolchain doesn't work anymore.
If I try to point the android.toolchain.cmake script to NDK R18, it fails with this error message:
Android: Targeting API '22' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
CMake Error at C:/app/cmake/share/cmake-3.12/Modules/Platform/Android/Determine-Compiler-NDK.cmake:97 (message):
Android: No toolchain for ABI 'armeabi-v7a' found in the NDK:
I think it might be related to the fact that Android NDK now switched from GCC to Clang. So I tried an older NDK R16b. Now it gets a little bit further but still fails now with this error message:
CMake Error at C:/app/cmake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler
"c:/app/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp
Run Build Command:"C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe" "cmTC_9e009/fast"
C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe -f CMakeFilescmTC_9e009.dirbuild.make CMakeFiles/cmTC_9e009.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o
c:appandroid-ndk-r16btoolchainsarm-linux-androideabi-4.9prebuiltwindows-x86_64binarm-linux-androideabi-gcc.exe
-target armv7-none-linux-androideabi --sysroot=C:/app/android-ndk-r16b/platforms/android-22/arch-arm -isystem C:appandroid-ndk-r16bplatformsandroid-22arch-armusrinclude
-isystem C:appandroid-ndk-r16bplatformsandroid-22arch-armusrincludearm-linux-androideabi
-g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -fPIE -o CMakeFilescmTC_9e009.dirtestCCompiler.c.o -c C:MojeQtProjectstaglib_buildCMakeFilesCMakeTmptestCCompiler.c
arm-linux-androideabi-gcc.exe: error: armv7-none-linux-androideabi: No such file or directory
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-target'
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-fno-integrated-as'
arm-linux-androideabi-gcc.exe: error: unrecognized command line option '-fno-limit-debug-info'
CMakeFilescmTC_9e009.dirbuild.make:64: recipe for target 'CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_9e009.dir/testCCompiler.c.o] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Moje/QtProjects/taglib_build/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_9e009/fast' failed
mingw32-make.exe: *** [cmTC_9e009/fast] Error 2
I don't understand what is wrong with the test command and why it fails. Do you have any idea?
And after all is my approach to build a dynamic Android library correct or are there better ways to do it? I don't use Android Studio, I develop my application in QtCreator.
edited Nov 22 at 15:39
asked Nov 22 at 11:44
JeCh
315138
315138
Please, format build logs as a code (Ctrl+Kor{}button), not as a blockquote. The latter formatting doesn't preserve newlines; it is very difficult to read such logs.
– Tsyvarev
Nov 22 at 12:21
add a comment |
Please, format build logs as a code (Ctrl+Kor{}button), not as a blockquote. The latter formatting doesn't preserve newlines; it is very difficult to read such logs.
– Tsyvarev
Nov 22 at 12:21
Please, format build logs as a code (
Ctrl+K or {} button), not as a blockquote. The latter formatting doesn't preserve newlines; it is very difficult to read such logs.– Tsyvarev
Nov 22 at 12:21
Please, format build logs as a code (
Ctrl+K or {} button), not as a blockquote. The latter formatting doesn't preserve newlines; it is very difficult to read such logs.– Tsyvarev
Nov 22 at 12:21
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430291%2fcmake-configure-for-android-fails%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please, format build logs as a code (
Ctrl+Kor{}button), not as a blockquote. The latter formatting doesn't preserve newlines; it is very difficult to read such logs.– Tsyvarev
Nov 22 at 12:21