包括uuid.h到的Android NDK项目 [英] Include uuid.h into Android NDK project
问题描述
我移植使用NDK一个C程序到Android系统。该程序使用 uuid.h
或 UUID / uuid.h
库根据可在其中。当我编译程序,给出了错误信息 uuid.h:没有这样的文件或目录
。
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
.
我是新来的NDK,所以我不是很确定是什么问题。我使用的cygwin的Windows;没有电脑没有 uuid.h
库或Android不支持呢?是否有一个workaround-我可以以某种方式将其包含在编译器设置?
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);
也许我可以用我自己的C code模仿这种行为?
Perhaps I could emulate this behaviour with my own C code?
感谢提前任何帮助!
推荐答案
uuid.h
不是NDK的一部分。您可以通过运行检查找到的/ opt / Android的NDK-R8B / -name uuid.h
uuid.h
isn't part of the NDK. You can check by running find /opt/android-ndk-r8b/ -name uuid.h
您也许可以拉你从AOSP需要code。我发现外部/的e2fsprogs / lib中/ UUID / 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.
这篇关于包括uuid.h到的Android NDK项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!