Android NDK not building, can't find platform system directory

I’ve been trying to build the hxcpp folder for android via neko build.n android in the project folder and have run into a number of problems.

First, for some reason HXCPP couldn’t find files in the ndk/platforms folder, so I got rid of the code that searches for the best platform in the Setup.hx file and hard-coded it to set the best version to the platform I am targeting (Android 19)

This worked, but now, the ndk cannot find the platform system header files. For instance, if I try to build hxcpp for android (or if I try to build a project for android via openfl build android or lime build android), an error is thrown in the console stating that there is no such header stdint.h.

So I went to the source file to look at the problem, the source file (also named stdint.h, inside the prebuilt directory for the targeted infrastructure) simply includes the platform system header file via #include_next <stdint.h>

Also, I noticed that the API level was missing, therefore when running neko build.n android the compiler tags included directories that didn’t exist (because there was a blank folder name in the path where the API level should’ve been), so I set the API level to 4.9 and this fixed the include paths, but the error persisted. Though I’m sure it probably fixed some other error I would’ve run into down the line.

I have NDK r16b currently, and I have a very limited knowledge of building cross-platform applications, and everything I know is from searching these forums, and also googling for a total of about 10 hours now. I did notice NDK r16b included something called Unified Headers:

I have no idea what this is about, but this seems to be the root of the issue. I previously tried ndk r8b (the one the lime setup installed) and that failed because the ndk was too old (or so I read from posts on these forms)

As of right now it seems like I just need to either:

  1. use an ndk version below r14b (where Unified Headers were implemented). For this I was planning to try downloading ndk r13b (solely because it’s the latest ndk that @singmajesty mentioned using AFAIK)
    or
  2. somehow change the platform system directory (Is this the sysroot variable?? If so, which directory would the platform system header files be located? I tried just setting it to the ANDROID_NDK_ROOT in the android toolchain xml for giggles and it doesn’t change anything, same error occurs)

I’m at work right now, so there’s a limited amount of additional information I can really provide, but if there is additional info that would be helpful, let me know and I will provide it later in the day.

Below is a list of things I’ve already done:

  • installed latest hxcpp version from github and also followed the instructions for building there
  • set lime and openfl to the correct versions for compatibility with Flixel (using info I found on these forums)
  • downloaded the sdk, ndk, ant and jdk
  • setup the .lime/config.xml
  • setup the hxcpp_config.xml file (actually I didn’t change anything here, but it looked like everything should run smoothly there since the lime config was setup properly)

P.S. sorry for the lengthiness of this post! I am new here.

https://android.googlesource.com/platform/ndk/+/ndk-release-r16/docs/UnifiedHeaders.md

The above link states that in r16b old headers were removed. I’ll attempt this process again with ndk r13b and post my results later.

If you have Lime installed, and configured for Android development, you can use lime rebuild hxcpp android to have it build. However, you should not have to rebuild HXCPP anymore, as it includes whatever libs it needs as static libs as a part of the Lime application build, so long as you use Haxe 3.4.4, I believe.

So Haxe 3.4.4 plus the latest haxelib HXCPP should work fine with Lime, and you want a newer NDK because the older ones broke when run on Android N devices, if I recall properly

I’ll try that when I get home, but IIRC the last time I tried this it threw an error about a missing shared object file: Source path “C:/(HXCPP_PATH)/bin/Android/libstd-v7.so”

Which then led me to check the bin folder, and my HXCPP bin directory doesn’t have an Android folder.

Which was what led me back to attempting to build the neko files. It seemed like neko build.n windows worked just fine, as the binary files for windows in the HXCPP bin folder are there, which is what led me to attempt neko build.n android which has yet to succeed for me. As it usually throws an error on (4 times i believe) saying that some standard library file (included with angular brackets in the offending code) does not exist

ETA: ^ before saying compilation failed and the process had been terminated"

EDIT: Also I’m not sure what version of Haxe I’m running, I download whatever was the latest two weeks ago, I will also find this out when I get home

ETA: Quick google search revealed that I do indeed have 3.4.4 as it is the latest version as of October 8th

It may or not be worth it to note that pretty much all openfl and lime commands targeting the Android platform threw the same error about missing .so files

Oh, then perhaps it is the version of OpenFL and Lime you are using. We no longer require there to be an HXCPP std library file. If you use an older version, you can still try running lime rebuild hxcpp android to have it compile those files in your HXCPP install

Yeah, HaxeFlixel is not compatible with the latest version of OpenFL or Lime, unfortunately.

EDIT: Are you saying I can use the latest version to rebuild android, and then revert to the older versions?

So I just got home, and I tried lime rebuild hxcpp android on the latest versions of lime and openfl and it says throws Process creation failure : arm-linux-androideabi-g++

Here’s the verbose output

PS C:\Users\Dell\ChaosMechanica> lime rebuild hxcpp android -verbose

_/\\\\\\______________________________________________
_\////\\\______________________________________________
_____\/\\\_____/\\\_____________________________________
______\/\\\____\///_____/\\\\\__/\\\\\_______/\\\\\\\\___
_______\/\\\_____/\\\__/\\\///\\\\\///\\\___/\\\/////\\\__
________\/\\\____\/\\\_\/\\\_\//\\\__\/\\\__/\\\\\\\\\\\___
_________\/\\\____\/\\\_\/\\\__\/\\\__\/\\\_\//\\///////____
________/\\\\\\\\\_\/\\\_\/\\\__\/\\\__\/\\\__\//\\\\\\\\\\__
________\/////////__\///__\///___\///___\///____\//////////___

Lime Command-Line Tools (5.9.1)

Initializing project...
Reading Lime config: C:\Users\Dell\.lime\config.xml
Using target platform: ANDROID

Running command: REBUILD
 - Changing directory: C:\Users\Dell\hxcpp/git/project
 - Running command: haxelib run hxcpp Build.xml -Dandroid -DPLATFORM=android-9 -Dtools=5.9.1 -Drebuild=1 -verbose
 __
/\ \
\ \ \___    __  _   ___   _____   _____
 \ \  _ `\ /\ \/'\ /'___\/\ '__`\/\ '__`\
  \ \ \ \ \\/>  <//\ \__/\ \ \L\ \ \ \L\ \
   \ \_\ \_\/\_/\_\ \____\\ \ ,__/\ \ ,__/
    \/_/\/_/\//\/_/\/____/ \ \ \/  \ \ \/
                            \ \_\   \ \_\
                             \/_/    \/_/

hxcpp (Haxe C++ Runtime Support) (3.4.0)

Using makefile: Build.xml
Reading HXCPP config: C:\Users\Dell\.hxcpp_config.xml
No specified toolchain

 - Parsing include: C:/Users/Dell/hxcpp/git/toolchain/setup.xml
 - Parsing include: C:\Users\Dell\.hxcpp_config.xml (section "vars")
 - Parsing include: C:/Users/Dell/hxcpp/git/toolchain/finish-setup.xml
 - Parsing makefile: C:\Users\Dell\hxcpp\git\project\Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/git/build-tool/BuildCommon.xml
 - Parsing include: C:/Users/Dell/hxcpp/git/toolchain/haxe-target.xml
 - Parsing include: C:/Users/Dell/hxcpp/git/project/libs/std/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/git/project/libs/zlib/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/git/project/libs/regexp/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/git/project/libs/mysql/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/git/project/libs/sqlite/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/git/toolchain/android-toolchain.xml

Using Android NDK root: ndk-latest/android-ndk-r16b
Detected Android NDK r16
Using Android NDK platform: android-9

 - Adding path: ndk-latest/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin
 - Parsing include: C:/Users/Dell/hxcpp/git/toolchain/gcc-toolchain.xml
 - Parsing compiler: C:/Users/Dell/hxcpp/git/toolchain/common-defines.xml
 - Parsing include: C:\Users\Dell\.hxcpp_config.xml (section "exes")

Using compile threads: 3

 - Changing directory: C:/Users/Dell/hxcpp/git/project/libs/std
 - Running command: arm-linux-androideabi-g++ -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/git/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -Wno-overflow "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -DHXCPP_ARMV5 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=9 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/git/project/libs/std/Sys.cpp -oC:/Users/Dell/hxcpp/git/project/libs/std/obj/android/d6864f50_Sys.obj
 - Running command: arm-linux-androideabi-g++ -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/git/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -Wno-overflow "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -DHXCPP_ARMV5 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=9 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/git/project/libs/std/Xml.cpp -oC:/Users/Dell/hxcpp/git/project/libs/std/obj/android/d6864f50_Xml.obj
 - Running command: arm-linux-androideabi-g++ -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/git/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -Wno-overflow "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -DHXCPP_ARMV5 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=9 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/git/project/libs/std/Process.cpp -oC:/Users/Dell/hxcpp/git/project/libs/std/obj/android/d6864f50_Process.obj
Process creation failure : arm-linux-androideabi-g++

HXCPP versions prior to 3.4.0 (any of the 3.3 releases, for example) should also include the std binaries

EDIT: You could also try commenting out/removing the <ndll name="std" haxelib="hxcpp" /> tag from your older version of Lime

I tried HXCPP 3.3; same error. Also I was building on the latest version of lime, however the same error occurs on older versions so I imagine that I haven’t even reached the point where that tag would cause a problem.

However, I stumbled upon a post that alluded to the fact that for some reason access may have been denied to arm-linux-androideabi-G++, so I ran the command prompt as an administrator and I got different errors


_/\\\\\\______________________________________________
_\////\\\______________________________________________
_____\/\\\_____/\\\_____________________________________
______\/\\\____\///_____/\\\\\__/\\\\\_______/\\\\\\\\___
_______\/\\\_____/\\\__/\\\///\\\\\///\\\___/\\\/////\\\__
________\/\\\____\/\\\_\/\\\_\//\\\__\/\\\__/\\\\\\\\\\\___
_________\/\\\____\/\\\_\/\\\__\/\\\__\/\\\_\//\\///////____
________/\\\\\\\\\_\/\\\_\/\\\__\/\\\__\/\\\__\//\\\\\\\\\\__
________\/////////__\///__\///___\///___\///____\//////////___

Lime Command-Line Tools (5.9.1)

Initializing project...
Reading Lime config: C:\Users\Dell\.lime\config.xml
Using target platform: ANDROID

Running command: REBUILD
 - Changing directory: C:\Users\Dell\hxcpp/3,3,49/project
 - Running command: haxelib run hxcpp Build.xml -Dandroid -DPLATFORM=android-9 -Dtools=5.9.1 -Drebuild=1 -verbose
 __
/\ \
\ \ \___    __  _   ___   _____   _____
 \ \  _ `\ /\ \/'\ /'___\/\ '__`\/\ '__`\
  \ \ \ \ \\/>  <//\ \__/\ \ \L\ \ \ \L\ \
   \ \_\ \_\/\_/\_\ \____\\ \ ,__/\ \ ,__/
    \/_/\/_/\//\/_/\/____/ \ \ \/  \ \ \/
                            \ \_\   \ \_\
                             \/_/    \/_/

hxcpp (Haxe C++ Runtime Support) (3.3.49)

Using makefile: Build.xml
Reading HXCPP config: C:\Users\Dell\.hxcpp_config.xml
No specified toolchain

 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/toolchain/setup.xml
 - Parsing include: C:\Users\Dell\.hxcpp_config.xml (section "vars")
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/toolchain/finish-setup.xml
 - Parsing makefile: C:\Users\Dell\hxcpp\3,3,49\project\Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/build-tool/BuildCommon.xml
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/toolchain/haxe-target.xml
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/project/libs/zlib/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/project/libs/regexp/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/project/libs/mysql/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/project/libs/sqlite/Build.xml
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/toolchain/android-toolchain.xml

Using Android NDK root: ndk-latest/android-ndk-r16b
Detected Android NDK r16
Using Android NDK platform: android-19

 - Adding path: ndk-latest/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin
 - Parsing include: C:/Users/Dell/hxcpp/3,3,49/toolchain/gcc-toolchain.xml
 - Parsing compiler: C:/Users/Dell/hxcpp/3,3,49/toolchain/common-defines.xml
 - Parsing include: C:\Users\Dell\.hxcpp_config.xml (section "exes")

Using compile threads: 3

 - Changing directory: C:/Users/Dell/hxcpp/3,3,49/project/libs/std
 - Compile : Sys.cpp
   arm-linux-androideabi-g++ --sysroot=ndk-latest/android-ndk-r16b/platforms/android-19/arch-arm -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/3,3,49/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=19 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Sys.cpp -oC:/Users/Dell/hxcpp/3,3,49/project/libs/std/obj/android/d6864f50_Sys.obj
 - Compile : Xml.cpp
   arm-linux-androideabi-g++ --sysroot=ndk-latest/android-ndk-r16b/platforms/android-19/arch-arm -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/3,3,49/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=19 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Xml.cpp -oC:/Users/Dell/hxcpp/3,3,49/project/libs/std/obj/android/d6864f50_Xml.obj
 - Compile : Process.cpp
   arm-linux-androideabi-g++ --sysroot=ndk-latest/android-ndk-r16b/platforms/android-19/arch-arm -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/3,3,49/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=19 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Process.cpp -oC:/Users/Dell/hxcpp/3,3,49/project/libs/std/obj/android/d6864f50_Process.obj
Error: While running :arm-linux-androideabi-g++ --sysroot=ndk-latest/android-ndk-r16b/platforms/android-19/arch-arm -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/3,3,49/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=19 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Xml.cpp -oC:/Users/Dell/hxcpp/3,3,49/project/libs/std/obj/android/d6864f50_Xml.obj
In file included from C:/Users/Dell/hxcpp/3,3,49/include/hx/OS.h:61:0,
                 from C:/Users/Dell/hxcpp/3,3,49/include/hx/CFFI.h:15,
                 from C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Xml.cpp:1:
c:\users\dell\ndk-latest\android-ndk-r16b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x\include\stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                          ^
compilation terminated.
Error: While running :arm-linux-androideabi-g++ --sysroot=ndk-latest/android-ndk-r16b/platforms/android-19/arch-arm -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/3,3,49/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=19 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Process.cpp -oC:/Users/Dell/hxcpp/3,3,49/project/libs/std/obj/android/d6864f50_Process.obj
In file included from C:/Users/Dell/hxcpp/3,3,49/include/hx/OS.h:61:0,
                 from C:/Users/Dell/hxcpp/3,3,49/include/hx/CFFI.h:15,
                 from C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Process.cpp:1:
c:\users\dell\ndk-latest\android-ndk-r16b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x\include\stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                          ^
compilation terminated.
Error: While running :arm-linux-androideabi-g++ --sysroot=ndk-latest/android-ndk-r16b/platforms/android-19/arch-arm -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -Indk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -IC:/Users/Dell/hxcpp/3,3,49/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=19 -Wa,--noexecstack -O2 -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti -std=c++11 C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Sys.cpp -oC:/Users/Dell/hxcpp/3,3,49/project/libs/std/obj/android/d6864f50_Sys.obj
In file included from C:/Users/Dell/hxcpp/3,3,49/include/hx/OS.h:61:0,
                 from C:/Users/Dell/hxcpp/3,3,49/include/hx/CFFI.h:15,
                 from C:/Users/Dell/hxcpp/3,3,49/project/libs/std/Sys.cpp:1:
c:\users\dell\ndk-latest\android-ndk-r16b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x\include\stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                          ^
compilation terminated

ETA: The missing header file issue was the issue I ran into when using neko build.n android

Which leads me to my original question, am I missing the system directory header files or is #include_next <stdint.h> just pointing to the wrong directory?

EDIT: Also thanks for taking the time to help me out with this, I’ve been reading through your posts for pretty much a day or two now haha, most of your older posts have gotten me up to this point, and though I have yet to succeed I’ve definitely come a lot further than I was a few days ago.

I copied and pasted the last executed arm-linux-androideabi-g++ call and ran it with a trailing -v

Noticed some unusual stuff going on that’s more than likely the problem.

ignoring nonexistent directory "c:\users\dell\ndk-latest\android-ndk-r16b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/include"
ignoring nonexistent directory "c:/users/dell/ndk-latest/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/../../include/c++/4.9.x"
ignoring nonexistent directory "c:/users/dell/ndk-latest/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/../../include/c++/4.9.x/arm-linux-androideabi"
ignoring nonexistent directory "c:/users/dell/ndk-latest/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/../../include/c++/4.9.x/backward"
ignoring duplicate directory "c:/users/dell/ndk-latest/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/../../lib/gcc/arm-linux-androideabi/4.9.x/include"
ignoring nonexistent directory "/tmp/df2ba04b9fa9816ab534243afdccc25f/sysroot/tmp/df2ba04b9fa9816ab534243afdccc25f/lib/gcc/arm-linux-androideabi/4.9.x/../../../../include"
ignoring duplicate directory "c:/users/dell/ndk-latest/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/../../lib/gcc/arm-linux-androideabi/4.9.x/include-fixed"
ignoring nonexistent directory "c:/users/dell/ndk-latest/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/../../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/include"
ignoring nonexistent directory "/tmp/df2ba04b9fa9816ab534243afdccc25f/sysroot/usr/include"
ignoring nonexistent directory "ndk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include"
ignoring nonexistent directory "ndk-latest/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include"
ignoring nonexistent directory "include"

I’m definitely missing something, because it is immediately after this that it fails to find <stdint.h>

EDIT: So far it seems like I’m missing well, everything. Where would these includes have come from?

I am facing the exact same issue fatal error: stdint.h: No such file or directory when building on Windows 10. Targeting Android is not possible with the latest NDK r16b using Haxe 3.4.7 with latest HXCPP/Lime/OpenFL versions available via haxelib. It works however by downgrading to NDK r15c which you can download from https://developer.android.com/ndk/downloads/older_releases.

As of NDK16 gcc is deprecated in favour of clang. This that the issue may be caused by unified headers introduced in the latest NDK release https://android-developers.googleblog.com/2017/09/introducing-android-native-development.html

@singmajesty are there any current plans to support the latest Android NDK?

1 Like

We’ll have to look at improving the android-toolchain.xml file in HXCPP to support the newer file :slight_smile:

1 Like