包括uuid.h到的Andr​​oid NDK项目 [英] Include uuid.h into Android NDK project

查看:2249
本文介绍了包括uuid.h到的Andr​​oid NDK项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我移植使用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到的Andr​​oid NDK项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆