0

I'm compiling C++ code written primarily for Mac OS, using the Android NDK and I get the following error:

- Type 'errno_t' could not be resolved

In Xcode this type is defined on OSX 10.0/usr/include/sys/_types/_errno_t.h as this:

#ifndef _ERRNO_T
#define _ERRNO_T
typedef int                    errno_t;  
#endif  /* _ERRNO_T */

Any suggestions on how to convert this to the NDK, or add compiler flags to make this compile, or where to even get the source code to define this type in my source code itself?

Thanks.

TooManyEduardos
  • 4,206
  • 7
  • 35
  • 66
  • 1
    Is `errno_t` a POSIX / ISO type? I don't see it defined under Linux. You may just need to define it yourself in a header if `_ERRNO_T` isn't defined (as in your question), or just throw `-Derrno_t=int` in your makefile. – fadden Feb 09 '15 at 16:41
  • it seems to be an int, at least in Obj-C, so im going with that for not until I find a better solution. – TooManyEduardos Feb 09 '15 at 16:42

1 Answers1

0

See this answer for information on errno_t.

errno_t is not a part of the C standard, and bionic doesn't support it.

The fix is simply to change all the errno_ts to be ints.

Community
  • 1
  • 1
Dan Albert
  • 10,079
  • 2
  • 36
  • 79