【问题标题】:Problem building STLport NDK r5/ Android构建 STLport NDK r5/Android 时出现问题
【发布时间】:2011-06-01 13:33:13
【问题描述】:

我正在尝试为 Android 构建 STLport。我得到了以下步骤,但它们不起作用:

1 - 使用以下方法克隆 STLport 存储库:

git clone git://stlport.git.sourceforge.net/gitroot/stlport/stlport

2 - 使用配置环境:

./configure --target=arm-eabi --with-extra-cxxflags="-fshort-enums" 
            --with-extra-cflags="-fshort-enums" 

3 - 从 src 目录构建它使用

make SYSROOT"{MY NDK path}/platforms/android-5/arch-arm/" release-static

但我收到以下错误:

In file included from ../stlport/stl/_alloc.h:45,
                 from ../stlport/memory:29,
                 from dll_main.cpp:41:
../stlport/stl/_new.h:45:24: error: new: No such file or directory
In file included from ../stlport/stl/_limits.h:36,
                 from ../stlport/limits:29,
                 from dll_main.cpp:48:
../stlport/stl/_cwchar.h:26:30: error: cstddef: No such file or directory
In file included from ../stlport/stl/_utility.h:35,
                 from ../stlport/utility:35,
                 from dll_main.cpp:40:
../stlport/type_traits:889: error: 'declval' was not declared in this scope
../stlport/type_traits:889: error: expected primary-expression before '>' token
../stlport/type_traits:889: error: expected primary-expression before ')' token
../stlport/type_traits:889: error: 'declval' was not declared in this scope
../stlport/type_traits:889: error: expected primary-expression before '>' token
../stlport/type_traits:889: error: expected primary-expression before ')' token
../stlport/type_traits:889: error: ISO C++ forbids declaration of 'decltype' with no type
../stlport/type_traits:889: error: ISO C++ forbids in-class initialization of non-const static member 'decltype'
../stlport/type_traits:889: error: template declaration of 'int std::tr1::detail::decltype'
../stlport/type_traits:942: error: ISO C++ forbids declaration of 'decltype' with no type
../stlport/type_traits:942: error: ISO C++ forbids in-class initialization of non-const static member 'decltype'
../stlport/type_traits:942: error: template declaration of 'int std::tr1::detail::decltype'
make: *** [obj/arm-eabi-gcc/so/dll_main.o] Error 1

我缺少任何包含目录或配置吗?

谢谢,

塞尔吉奥

【问题讨论】:

    标签: android android-ndk stlport


    【解决方案1】:

    Android NDK r5 现在支持 STL,只需将 APP_STL := stlport_static 添加到您的 Android.mk 文件中,APP_STL 变量的有效选项是;

    • stlport_static
    • stlport_shared
    • gnustl_static

    请注意,只有gnustl_static 变体支持异常。

    【讨论】:

    • 嗨。我正在尝试构建 STLport,因为它是我正在尝试构建的另一个库的先决条件。这个库是一个没有 Android.mk 的第三方库,只有一个常规的 Makefile。有没有其他方法可以设置 APP_STL 以启用 STL 支持?我尝试直接在 Makefile 上添加包含文件和 stlport_static(将它们添加到 -I 和 -l 参数)。构建更进一步,但他们失败了,所以也许这些改变还不够。
    【解决方案2】:

    我已经设法使用 STLPort GIT 存储库在 Android NDK R3 上编译 STL-Port。然而,一些“适应”是必要的。您可以在程序here 上找到说明。它也应该适用于 NDK R5。

    希望对您有所帮助。

    【讨论】:

      【解决方案3】:

      git 上的最后一个版本好像坏了。尝试使用以前的版本(我使用的是 2010 年 12 月 1 日星期三的版本,效果很好)。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-10-20
        • 2011-05-29
        • 1970-01-01
        • 2012-03-23
        • 1970-01-01
        • 1970-01-01
        • 2013-08-16
        • 1970-01-01
        相关资源
        最近更新 更多