Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include uuid.h into Android NDK project

I'm porting a C program onto Android using the NDK. The program uses the uuid.h or uuid/uuid.h library depending on which is available. When I compile the program, gives the error message uuid.h: No such file or directory.

I'm new to the NDK, so I'm not entirely sure what the problem is. I'm using cygwin on Windows; does the computer not have the uuid.h library or Android doesn't support it? Is there a workaround- can I include it somehow in the compiler settings?

Finally, the program only uses the library like so:

char     *s;
uuid_t    uu;
uuid_create(&uu, NULL);
uuid_to_string(&uu, &s, 0);

Perhaps I could emulate this behaviour with my own C code?

Thanks for any help in advance!

like image 242
yellow Avatar asked Aug 09 '12 16:08

yellow


1 Answers

uuid.h isn't part of the NDK. You can check by running find /opt/android-ndk-r8b/ -name uuid.h

You can probably pull the code you need from the AOSP. I found external/e2fsprogs/lib/uuid/uuid.h in the master branch.

like image 62
Frohnzie Avatar answered Oct 03 '22 05:10

Frohnzie