Solved Error build project on linux for android.
-
Means used:
Ubuntu 20.04
Qt 5.12.11 android arm64-v8a
NDK 21.3.6528147
Error:
/home/dev/android/ndk/21.3.6528147/sources/cxx-stl/llvm-libc++/include/cmath:319: error: no member named 'isfinite' in the global namespace
In file included from main.cpp:1:
/home/dev/android/ndk/21.3.6528147/sources/cxx-stl/llvm-libc++/include/cmath:319:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
~ ~^
and other cmath print functions fail.
There are also typeinfo errors:
/home/dev/android/ndk/21.3.6528147/sources/cxx-stl/llvm-libc++/include/typeinfo:215: error: cast from pointer to smaller type 'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t' (aka 'unsigned int') loses information
In file included from test.cpp:1:
In file included from /home/dev/android/ndk/21.3.6528147/sources/cxx-stl/llvm-libc++/include/memory:653:
/home/dev/android/ndk/21.3.6528147/sources/cxx-stl/llvm-libc++/include/typeinfo:215:14: error: cast from pointer to smaller type 'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t' (aka 'unsigned int') loses information
return reinterpret_cast<__type_name_t>(__v);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~How to fix it?
-
Your NDK is too new: https://doc.qt.io/qt-5.14/android-getting-started.html, you need to downgrade to 19.x. Or upgrade Qt to 5.15.x.
-
@sierdzio But Qt Creator itself installed this version of the NDK. Why did he do this?
-
@sierdzio I Installed NDK 21 but QtCreator has error
-
@TheGringerEye said in Error build project on linux for android.:
I Installed NDK 21 but QtCreator has error
You have to install android command line tools.
You can do it at command line:cd <ANDROID_SDK_ROOT>/tools/bin/ ./sdkmanager --sdk_root=<ANDROID_SDK_ROOT> --install "cmdline-tools;latest"
Or with QtCreator, on same Dialog at bottom, select:
- SDK Manager
- Show all Packages
- select in Tools following packages:
- Android SDK Command-line Tools (latest)
- click on "apply"
-
@KroMignon I installed all avalibles NDK ver 21, errors in Qt Creator was resolved. But build errors didn't go away(
-
@TheGringerEye said in Error build project on linux for android.:
But build errors didn't go away(
Which build error do you have?
-