Issue
I would like to use this language C code in Android by NDK. Data types __off_t and __off64_t are defined in bits/types.h, but I am getting: fatal error: 'bits/types.h' file not found while building app.
I can make a binary a run C program on Ubuntu without any problems but in Android there is problem with include.
#include <jni.h>
#include <stdio.h>
#include <android/log.h>
#include <bits/types.h> <------- not found
Solution
Identifiers starting with underscores and the contents of the bits directory are not guaranteed to be portable.
Android has a definition for off64_t and off_t (no underscores) in the <sys/types.h> header.
So you should be able to do:
#include <sys/types.h>
typedef off64_t __off64_t;
typedef off_t __off_t;
... or just rename the types in the code you are trying to port.
... or you can use the the ftruncate64 call that android ships in <unistd.h>?
Answered By - Botje
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.