android external/stlport 包含在 Android.mk 中构建未成功

发布于 2024-11-19 05:26:03 字数 723 浏览 5 评论 0原文

我正在尝试使用 android-froyo 源代码构建一个应用程序,其中我使用 skiastl 模板,

我已经包含了

MY_INCLUDES=external/zlib external/jpeg external/freetype/include \
    frameworks/base/core/jni/android/graphics  external/skia/include/core \
    external/libpng external/expat/lib <b>external/stlport/stlport</b>

libstlport_cflags := -D_GNU_SOURCE
libstlport_cppflags := -fuse-cxa-atexit 

LOCAL_CPPFLAGS := $(libstlport_cppflags)
include $(BUILD_STATIC_LIBRARY)

当我尝试构建时出现以下错误这个应用程序的android源代码,我保存在packages/apps中:

external/stlport/stlport/stl/_new.h:47:50:错误:libstdc++/include/new:没有这样的文件或目录

请指导我纠正此问题。

谢谢莫希特

I m trying to build an app with android-froyo source in which I am using skia and stl templates,

I have included

MY_INCLUDES=external/zlib external/jpeg external/freetype/include \
    frameworks/base/core/jni/android/graphics  external/skia/include/core \
    external/libpng external/expat/lib <b>external/stlport/stlport</b>

libstlport_cflags := -D_GNU_SOURCE
libstlport_cppflags := -fuse-cxa-atexit 

LOCAL_CPPFLAGS := $(libstlport_cppflags)
include $(BUILD_STATIC_LIBRARY)

I get the following error when i try to build the android source with this app, which i kept at packages/apps:

external/stlport/stlport/stl/_new.h:47:50: error: libstdc++/include/new: No such file or directory

Please guide me to rectify this issue.

Thanks

Mohit

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

江湖正好 2024-11-26 05:26:03

据我了解,预处理器无法找到的文件位于 bionic 文件夹中。

我遇到了同样的问题,我通过添加以下行解决了它:

LOCAL_C_INCLUDES += bionic

As I understand the file which cannot be found by preprocessor is located in bionic folder.

I had the same issue and I solved it by adding the following line:

LOCAL_C_INCLUDES += bionic
↘人皮目录ツ 2024-11-26 05:26:03

我还没有在 Android 2.2 上尝试过这个,但我正在使用 Android Kitkat (4.4)。

为了让 stlport 库与我们的项目配合使用,我们将其包含在我们项目的 Android.mk 中,如下所示

include external/stlport/libstlport.mk

:假设在 Froyo 上,有一个 libstlport.mk 文件要包含在您的构建过程中。在 4.4 中,还有一个 Android.mk 文件,但它也构建其他代码并将 stlport 构建为静态库(这不是我们想要的)。

您可能还需要添加包含目录,例如:external/stlport/stlport

I haven't tried this with Android 2.2 but I'm using Android Kitkat (4.4).

To get the stlport library working with our project we included it in our project's Android.mk as so:

include external/stlport/libstlport.mk

This is assuming that on Froyo, there is a libstlport.mk file to include in your build process. In 4.4, there is also a Android.mk file but that builds other code as well and builds stlport as a static library (which is not what we wanted).

You may need to also add the include directory as well, something like: external/stlport/stlport.

月亮是我掰弯的 2024-11-26 05:26:03
cpp
#include <stdio.h>
// The code 
// The set of definitions and includes for STLPort 
// They used defined() instead of #ifdef. 
#define _STLP_HAS_INCLUDE_NEXT  1 
#define _STLP_USE_MALLOC   1 
#define _STLP_USE_NO_IOSTREAMS  1 
#include <stl/config/_android.h> 
#include <map>
#include <string> 

int main(void)
{
    std::string a = "abc";
    printf("%s",a.c_str());
    return 0;
}

Android.mk
# A simple test for the minimal standard C++ library
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := test-libstl.cpp
LOCAL_C_INCLUDES += sources/cxx-stl/stlport/stlport
LOCAL_SHARED_LIBRARIES += libstlport 
LOCAL_MODULE := test-libstl
include $(BUILD_EXECUTABLE)
cpp
#include <stdio.h>
// The code 
// The set of definitions and includes for STLPort 
// They used defined() instead of #ifdef. 
#define _STLP_HAS_INCLUDE_NEXT  1 
#define _STLP_USE_MALLOC   1 
#define _STLP_USE_NO_IOSTREAMS  1 
#include <stl/config/_android.h> 
#include <map>
#include <string> 

int main(void)
{
    std::string a = "abc";
    printf("%s",a.c_str());
    return 0;
}

Android.mk
# A simple test for the minimal standard C++ library
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := test-libstl.cpp
LOCAL_C_INCLUDES += sources/cxx-stl/stlport/stlport
LOCAL_SHARED_LIBRARIES += libstlport 
LOCAL_MODULE := test-libstl
include $(BUILD_EXECUTABLE)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文