Android NDK:gnustl_static 库文档?
我是一名 Java 开发人员,到目前为止,我对 C++/JNI 的接触还很有限。
到目前为止,我已经做得很好了,但现在我正在尝试做“聪明”的事情,我变得越来越受到盲目飞行的限制:
我正在使用 gnustl_static 库,因为我已经使用了其他代码移植到同一个本机项目空间中。然而,由于库的精简性质,我发现用一只手绑在背后学习 C++ 非常困难。
如果有一个 Javadoc(显然不是 Javadoc ;))或一些此类文档,我可以使用它们来查找该库中包含的内容,进而查找这些库中包含的内容(当我希望月亮)为什么不包括某些类型(例如“地图”)以及最好使用什么!
从过去几周的谷歌搜索来看,我没有遇到过任何集中式的和集中式的。有用的资源以及其他人的知识和专业知识,我觉得我缺少一个重要且基本的资源!
有人可以帮我指点一下文档、教程、示例或者其他可以帮助我在 JNI/C++/Native Android 编码的危险水域中航行的东西吗?
编辑:
有人向我解释说,STL 是标准模板库,并且有一个链接指向其中包含的内容: http://www.sgi.com/tech/stl/stl_index.html
他们还解释说 gnustl_static 库是基于 GNU 机器的 STL 库,它是位于内部的一组标头: ${ANDROID-NDK}\sources\cxx-stl\gnu-libstdc++\include
足以说这对我有不可估量的帮助,因为我不知道发生了什么。我只是不知道该去哪里寻找。
我还是有点担心STL似乎不属于某人? (我在这里考虑的是 Apache 风格的主体)。有人能纠正我吗?
正如你所知。这里还是有点飘忽不定。
编辑2:
如果STL是用于描述所有非原始类型和函数的库...为什么要从以下位置提取string.h: ${ANDROID-NDK}\platforms\android-9\arch-arm\usr\include
PS:我知道我在这里听起来很愚蠢,但我保证我只是不知情。我只是不确定从哪里开始寻找,因为我觉得有必要从中间开始。再说一次,任何你认为我觉得有用的链接都会很棒!
I'm a Java developer by trade and my exposure to C++ / JNI has been limited until now.
I've managed to do pretty well so far but now that I'm venturing into doing "Clever" things I'm becoming more and more limited by flying blind:
I'm using the gnustl_static library because of other code which I've ported in the same native project space. However I'm finding it very difficult to learn C++ with one hand tied behind my back due to the cut down nature of the library.
It would all be fine is there was a Javadoc (Obviously not a Javadoc ;)) or some such documentation which I could use to find what was included inside this library and in turn, what was contained within those libraries (and while I'm wishing for the moon) why certain types such as "map" aren't included and what best to use instead!
From searching Google these past weeks I've not run across any centralised & useful resource and from everyone else's knowledge and expertise I feel like I'm missing a vital and basic resource!
Could someone please give me a hand and point me to Documentation or Tutorials or Examples or something which will help me navigate the dangerous waters of JNI / C++ / Native Android coding?
EDIT:
Someone has explained to me that STL is Standard Template Library and there is a link to what is contained within it here:
http://www.sgi.com/tech/stl/stl_index.html
They have also explained that gnustl_static library is the STL library based on GNU machines and it is a set of headers located inside:
${ANDROID-NDK}\sources\cxx-stl\gnu-libstdc++\include
Suffice to say this has immeasurably helped me out since I had no idea what was going on. I just didn't know enough to know where to look.
I'm still slightly worried by the fact that STL doesn't seem to be owned by someone? (I'm thinking Apache style body here). Can anyone correct me on that?
As you can tell. Still a little adrift here.
EDIT2:
If the STL is the library used to describe all non primitive types and functions... why is string.h being pulled from:
${ANDROID-NDK}\platforms\android-9\arch-arm\usr\include
PS: I know I sound stupid here but I promise I'm just uninformed. I'm just not sure where to start looking as I feel through necessity I've started in the middle. Again, links to anything you think I would find useful would be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
gnustl_static
是 GNU stdlibc++,因为它随 gcc 一起提供。这是官方文档在这里,但作为教程可能没用,所以最好买一些像样的书C++。图书馆似乎没有被削减。在您看来可能是这样,因为规范中定义的标准 C++ 库比 Java 中的库小很多。它具有对文件的标准访问权限,但没有文件操作,没有线程,没有网络等。
在 android POSIX 接口已普遍可用(纯 C)。如果您需要 C++,请尝试获取 boost,它将各种特定于系统的接口包装在不错的可移植 C++ 组件中。然而,Android平台上的许多服务只有通过Java层才能使用。
广告编辑:标准库规范是由某人拥有的,即 ISO。遗憾的是,该标准无法从 ISO 免费下载,但通过网络搜索可以发现这一点。
Ad Edit2:C++ 标准库基于底层 C 标准库。 C++ 标准库具有无扩展头文件,而标准 C 库具有带有后缀
.h
的头文件。两者均由(不同的)ISO 标准定义。 C 库与操作系统联系最紧密(取决于进行系统调用的特定方法),因此它是随系统提供的。另一方面,C++ 库与编译器的联系更加紧密,因为它使用 C 库与系统对话,因此它是随编译器一起提供的。这就是为什么他们住在不同的地方。gnustl_static
is GNU stdlibc++ as it comes with gcc. It's official documentation is here, but it's probably useless as tutorial, so preferably get some decent book on C++.The library does not appear to be cut down. It may look like that to you because standard C++ library defined in the specification is simply lot smaller than the one in Java. It has standard access to files, but no file manipulation, no threads, no network etc.
In android POSIX interface is generally available (plain C). If you want C++, try getting boost, which wraps the various system-specific interfaces in decent portable C++ components. However, many services on the Android platform won't be available except by going through the Java layer.
Ad Edit: Standard library specification is owned by somebody, namely ISO. Unfortunately the standard is not freely downloadable from ISO, but searching the web reveals this.
Ad Edit2: The C++ standard library is based on the underlying C standard library. The C++ standard library has the extension-less headers, while the standard C library has headers with suffix
.h
. Both are defined by (different) ISO standards. The C library is most tied to the operating system (depends on specific method to make system calls), so it's provided with the system. On the other hand the C++ library is more tied to the compiler while it uses the C library to talk to the system, so it's provided with the compiler. That's why they live in different places.