Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

fatal error: stdlib.h: No such file or directory #include <stdlib.h>



  • Hey guys
    During running the "hello world" for getting android apk output, I faced with the below error. Anyone has any idea to solve it??
    i used NDK 64 & 32 but i didnt get diffrent result.

    thank you

    the compile output message :

    12:36:17: Running steps for project untitled16...
    12:36:17: Starting: "C:\Qt\Qt5.7.0\5.7\android_armv7\bin\qmake.exe" C:\Users\sanaat\Desktop\QML-test\untitled16\untitled16.pro -r -spec android-g++
    12:36:18: The process "C:\Qt\Qt5.7.0\5.7\android_armv7\bin\qmake.exe" exited normally.
    12:36:18: Starting: "C:\Qt\Qt5.7.0\Tools\mingw530_32\bin\mingw32-make.exe" 
    D:\androidSDK\android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove -std=c++11 -O2 -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -mthumb -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -Iuntitled16 -I. -I..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include -I..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include\QtQuick -I..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include\QtGui -I..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include\QtQml -I..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include\QtNetwork -I..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include\QtCore -I. -isystem D:\androidSDK\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\include -isystem D:\androidSDK\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include -isystem D:\androidSDK\android-ndk-r17b/platforms/android-9/arch-arm//usr/include -I..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\mkspecs\android-g++ -o main.obj untitled16\main.cpp
    In file included from D:\androidSDK\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\include/bits/stl_algo.h:59:0,
                     from D:\androidSDK\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\include/algorithm:62,
                     from ..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include/QtCore/qglobal.h:94,
                     from ..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include/QtCore/qcoreapplication.h:43,
                     from ..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include\QtGui/qguiapplication.h:43,
                     from ..\..\..\..\Qt\Qt5.7.0\5.7\android_armv7\include\QtGui/QGuiApplication:1,
                     from untitled16\main.cpp:1:
    D:\androidSDK\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\include/cstdlib:72:20: fatal error: stdlib.h: No such file or directory
     #include <stdlib.h>
                        ^
    compilation terminated.
    Makefile:476: recipe for target 'main.obj' failed
    mingw32-make: *** [main.obj] Error 1
    12:36:18: The process "C:\Qt\Qt5.7.0\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project untitled16 (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.0))
    When executing step "Make"
    12:36:18: Elapsed time: 00:01.
    


  • the problem was solved by cheanging the ndk version to android-ndk32-r10-windows-x86_64.zip downloaded from following page:

    [Edit ~aha_1980: Link removed. Please advice only official download sites. Thanks]


Log in to reply