Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8866287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:45:10+00:00 2026-06-14T16:45:10+00:00

I’m trying to compile STXXL under Android NDK r8b (I have the same problem

  • 0

I’m trying to compile STXXL under Android NDK r8b (I have the same problem under the newer r8c btw).

I’m compiling using gnustl_static.

I need C++11 support so initially I tried setting

LOCAL_CPPFLAGS := -std=c++11

but this threw up an error about uint64_t.

So I changed the flag to

LOCAL_CPPFLAGS :=-std=gnu++11

This helps a fair bit but when it starts compiling I get an error relating to the gnu stl.

Users/Gozzeh/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi/objs/stxxl/STXXL/algo/copy_and_sort_file.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -I/Users/Gozzeh/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include -I/Users/Gozzeh/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include -Ijni -DANDROID  -Wa,--noexecstack -fexceptions -frtti -Dnullptr=0 -D_ANDROID -std=gnu++11 -Ijni/STXXL/include -fexceptions  -O2 -DNDEBUG -g   -I/Users/Gozzeh/android-ndk-r8b/platforms/android-8/arch-arm/usr/include -c  jni/STXXL/algo/copy_and_sort_file.cpp -o ./obj/local/armeabi/objs/stxxl/STXXL/algo/copy_and_sort_file.o 
In file included from /Users/Gozzeh/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/set:60:0,
                 from jni/STXXL/include/stxxl/bits/io/simdisk_file.h:33,
                 from jni/STXXL/include/stxxl/bits/io/io.h:20,
                 from jni/STXXL/include/stxxl/io:13,
                 from jni/STXXL/algo/copy_and_sort_file.cpp:18:
/Users/Gozzeh/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_tree.h: In member function 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Base_ptr, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Base_ptr, const _Val&)':
/Users/Gozzeh/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_tree.h:1011:39: error: '_Arg' was not declared in this scope

I also get a whole load more errors relating to this _Arg parameter.

So looking at the first one the function looks like the following:

template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
    template<typename _Arg>
#endif
    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
#ifdef __GXX_EXPERIMENTAL_CXX0X__
    _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __p, _Arg&& __v)
#else
    _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __p, const _Val& __v)
#endif
    {
      bool __insert_left = (__x != 0 || __p == _M_end()
                || _M_impl._M_key_compare(_KeyOfValue()(__v), 
                              _S_key(__p)));

      // This line is the error location.
      _Link_type __z = _M_create_node(_GLIBCXX_FORWARD(_Arg, __v)); 

      _Rb_tree_insert_and_rebalance(__insert_left, __z,
                    const_cast<_Base_ptr>(__p),  
                    this->_M_impl._M_header);
      ++_M_impl._M_node_count;
      return iterator(__z);
    }

I can’t really understand where the problem is arising. Is gnu++11 not defining __GXX_EXPERIMENTAL_CXX0X__? Or is the problem that it’s not being used somewhere properly? I’m very confused as to what is causing the problem? I have STXXL compiling with gnu++11 under clang on the iphone but I guess that iphone is probably using a different STL implementation. Has anyone got any ideas on how I can fix this problem?

If you need any further info just ask!

Edit: So further to one of the comments here is my application.mk

APP_PLATFORM := android-8 
APP_STL      := gnustl_static
APP_GNUSTL_FORCE_CPP_FEATURES := exceptions rtti 
APP_OPTIM    := release APP_ABI      := all

and this is my android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
rwildcard       = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))

LOCAL_MODULE    := stxxl
LOCAL_CPP_FEATURES += exceptions
FILE_LIST       := $(call rwildcard, $(LOCAL_PATH)/STXXL/,*.cpp)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_CPPFLAGS  := -Dnullptr=0 -D_ANDROID -D__STDC_INT64__ -std=gnu++11 -I$(LOCAL_PATH)/STXXL/include
include $(BUILD_SHARED_LIBRARY)

Edit: Interestingly I just tried placing a #error temp inside the #ifdef __GXX_EXPERIMENTAL_CXX0X__ block in the stl_tree.h function i posted. The compiler does NOT throw an error on that part … so the define is never getting set which is, presumably, the cause of my issues. I’ve also specifically added a -D__GXX_EXPERIMENTAL_CXX0X__ but that makes no difference (its as if it gets undef’d).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:45:11+00:00Added an answer on June 14, 2026 at 4:45 pm

    I think your approach to build is too optimistic. I don’t know anything about STXXL but any non trivial project has a lot of details in their own make files so by throwing your own Android.mk and trying to include all possible source code files to build shouldn’t work.

    If you want to utilize ndk-build, you should carefully study the project and understand its details and incorporate those to your newly Android.mk file. For example if you check external directory under Android repository (in github they are listed as several sub projects) you can see many open source projects and how they are introduced to Android build system.

    After long and boring message, what I would suggest is to use NDK as a standalone tool chain. You can read about this $NDK/docs/STANDALONE-TOOLCHAIN.html. In short I was able to compile STLXX as a static library via the command below (my ndk was installed at ~/bin)

    NDK=~/bin/android-ndk-r8c PTHREAD_FLAG= COMPILER=”$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ –sysroot=$NDK/platforms/android-14/arch-arm -I$NDK/sources/cxx-stl/gnu-libstdc++/4.6/include -I$NDK/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include -L$NDK/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/ -lgnustl_shared” make library_g++

    At first build fails with a problem in file ./io/ufs_file_base.cpp. There are some obsolete uses of S_IREAD and S_IWRITE which is not supported by Android / Bionic. See bug report and reference.

    You should update the line 88 as below

    const int perms = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
    

    then

    <same build command again>
    

    now you should get libstxxl.a under lib. I don’t know if this is really works or not but since this was a build question, I hope it answers or gives you some directions.

    One last note is about ARM EABIs. Above command uses armeabi as you can see in specified directories, you might want to use armeabi-v7a if applicable to your target since that’s newer. From your error messages I can see that particular build was targeting xscale, if that’s not intentional it might be a good idea to get yourself familiarized with ARM architecture / product families.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.