Introduction
I'm trying to compile empty qt widget to android apk, just to test if my environment and configuration is correct. However it seems that for some reason compiler doesn't see some headers files.
Test Code (mainwindow.cpp)
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
It basically doesn't do anything, it's just compilation test.
My configuration
QT 5.8
OpenJDK 8.0.5120.1
Android SDK platform 27
Android NDK r16, 32bit and 64bit (tested both)
Windows 8.1 64 bit
QT Toolkits:
- Android for armeabi-v7a (GCC 4.9, Qt 5.8.0)
- Android for x86 (GCC 4.9,Qt 5.8.0)
The Question
Compilation of ever android apps, including this empty one mentioned above ends with:
stdlib.h: No such file or directory
Compiling desktop (*exe) apps works fine. I just can't configure correctly my environment for compilation android apk's. I tried with different versions of Android NDK, architecture, and with "QMAKE_CFLAGS_ISYSTEM=". Nothing works so far. What should I do to make it works?
UPDATE:
Thanks to @AlexCohn help I'm a bit closer to solve the issue. After changing NDK from r16 to r10e-x86 and SDK tools to 25.2.5, compilation goes a bit more, but not reach the end, as it brakes with the following command:
Building the android package failed! -- For more information, run this command with --verbose.
Proces "C:\Programming\Qt\5.8\android_armv7\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project and_test (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.8.0)) When executing step "Build Android APK"
UPDATE 2:
Issue seems to be solved. One more change is needed as QT 5.9 seems to have compatibility issues with some versions of OpenJDK or Java SE. After a research I found that it is nesesery to install Java SE Development Kit 8. With this version, and all previous changes, finally the compilation ends successfully.