简体   繁体   中英

Android NDK with Qt not able to locate header files

I am trying to deploy a Qt app to an Android device, though I receive the error about missing stdlib.h . I found out that this library is actually inside sub directory tr1 of includes. I modified the include<stdlib.h> to include<tr1/stdlib.h> . After this I encountered the error for locale.h . This files doesn't seem to be present anywhere in the NDK.

The app works fine if build for Desktop as the Linux GCC has all files in proper hierarchy.

Any fixes?

Finally, I resolved the issue. It was just the wrong Android NDK build I downloaded. My system architecture is x86_64 and the Android architecture is x86. The build I downloaded was that x86_64 Android. Make sure when downloading the target platform is your Android architecture.

Also, one might find several solutions recommending to create stand-alone build using make-standalone-toolchain.sh script and setting CXX home to this build and as well as set "sysroot". Please do not do it . It's not at all required. Just set the NDK path from Android option from Qt itself. That shall be enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM