我正在尝试为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目录使用
构建它制作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
我是否遗漏了包含目录或配置?
谢谢,
塞尔吉奥
答案 0 :(得分:2)
Android NDK r5现在支持STL,只需将APP_STL := stlport_static
添加到Android.mk
文件中,APP_STL
变量的有效选项为;
请注意,只有gnustl_static
变体支持例外。
答案 1 :(得分:0)
git上的最后一个版本似乎被打破了。尝试使用以前的版本(我使用了2010年12月1日星期三的版本,它工作正常)。
答案 2 :(得分:0)
我已经设法使用STLPort GIT存储库在Android NDK R3上编译STL-Port。然而,一些“适应”是必要的。您可以找到有关程序here的说明。它也适用于NDK R5。
希望有所帮助。