Ifaddrs.h header not found when compiling SDL for android

I am making an Android game with SDL that requires access to ifaddrs.h. when I compile for mac, it works fine. When I compile for Android, it says the file was not found.

I am trying to enable it like this:

#include <ifaddrs.h>

So i

gcc -M network.cpp

to find the dependencies on the file it is included in, so I can find the absolute location of ifaddrs, which

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/ifaddrs.h

so when i

#include "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/ifaddrs.h"

he finds this, but then errors when including some other ifaddrs dependency

#include <AvailabilityInternal.h>

Ok So why is the include behavior different when I try to compile for android vs for mac? (using ndkbuild or g ++ on Mac)? how can i make it work on android? What part of the knowledge / information do I lack for all this?

(OSX yosemite, 10.10 is currently running)

+5
2

MacOSX Android. , SDK.

Android ifaddrs.h (, , getifaddrs()). , :

https://github.com/kmackay/android-ifaddrs
https://github.com/morristech/android-ifaddrs
https://www.openhub.net/p/android-ifaddrs/

getifaddrs() Android, NDK .

, Linux.

+8

Android API 24 (Android 7.0 Nougat) ifaddrs.h ifaddrs.h, , SDK, .

, ifaddrs.h Google, Android; Gingerbread, C++ , , .

ifaddrs.h URL- Android Gingerbread ifaddrs.h:

https://android.googlesource.com/platform/libcore/+/refs/heads/gingerbread-release/luni/src/main/native/ifaddrs-android.h

, . Android ifaddrs.h, , .

Gingerbread 4 (Android 5.0, 6.0, 7.0 9.0), .

0

All Articles