Jump to content

  • Log In with Google      Sign In   
  • Create Account


std::string operations (i.e. stol, stoi) not found NDK8d


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 chris_01   Members   -  Reputation: 129

Like
0Likes
Like

Posted 20 March 2013 - 12:08 AM

I try to set up my first android project using ndk r8d with c++11 support. Some c+11 mechanisms work fine (i.e. lambada expressions), but when i try to use one of the new string operations, the compile fails ( error: 'stol' is not a member of 'std'). Here are my project settings:

 

  Application.mk

APP_MODULES := MyLib   

APP_CPPFLAGS := -std=gnu++0x  
APP_CPPFLAGS += -frtti
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -DDEBUG   

APP_ABI := armeabi-v7a
APP_PLATFORM:=android-14                      

APP_STL := gnustl_static
APP_GNUSTL_CPP_FEATURES := rtti exceptions

NDK_TOOLCHAIN_VERSION=4.7

 

  Are those functions actually not working?



Sponsor:

#2 Lightness1024   Members   -  Reputation: 702

Like
0Likes
Like

Posted 20 March 2013 - 09:11 AM

It is because with some versions of the NDK there is not STL included. You should download STL port for example. or micro STL, or apache STL god knows which your prefer.

also, I recommend downloading and setuping boost the fastest as you can into your project.

then you can use boost::lexical_cast for that. and cool python-like message formatters like boost::format. also cool string algorithms...



#3 chris_01   Members   -  Reputation: 129

Like
0Likes
Like

Posted 22 March 2013 - 12:11 AM

Thanks for the hint with the STL. I've also tried STLPort, but this is not an option, too many c++11 features are not supported yet.

 

Boost is also not an option for me, I've removed boost a few weeks ago, while the core boost features I've used until yet are now

elements of the new c++11 standard. I don't want to have boost dependencies anymore...

 

Meanwhile I've figured out that the visibility appears to be guarded inside "basic_string.h", quite possibly due to

"_GLIBCXX_HAVE_BROKEN_VSWPRINTF".



#4 Lightness1024   Members   -  Reputation: 702

Like
0Likes
Like

Posted 02 April 2013 - 09:24 AM

interesting :) yeah boost is greatly outdated by c++11, so it is super great if you have a recent compiler that supports it.



#5 frob   Moderators   -  Reputation: 19614

Like
0Likes
Like

Posted 02 April 2013 - 11:14 AM

interesting smile.png yeah boost is greatly outdated by c++11, so it is super great if you have a recent compiler that supports it.

I wouldn't call it "outdated by c++11".

 

The standard is still very new in terms of compiler life cycles.


There's a wiki showing how much of the c++11 standard is implemented in a few major compilers.  You will note that as of today NONE of the major compilers fully support the standard.  GCC is close, but still not complete as of today.

 

The GCC compiler is a bit of an oddball because most of the features were proven in experimental branches of the compiler.  The last of the major language features are still in the 4.8.1 branch.  You can get it in the latest nightly builds, but 4.8.1 won't be supported mainstream until June or so.  The N2670 changes won't make it in that build, so you are looking at close to the end of the year before all the major features are supported.


Edited by frob, 02 April 2013 - 11:17 AM.

Check out my personal indie blog at bryanwagstaff.com.

#6 Cornstalks   Crossbones+   -  Reputation: 6974

Like
0Likes
Like

Posted 02 April 2013 - 11:31 AM

Have you tried using the clang compiler? I'm curious if this is compiler specific or not.


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#7 frob   Moderators   -  Reputation: 19614

Like
0Likes
Like

Posted 02 April 2013 - 11:53 AM

Have you tried using the clang compiler? I'm curious if this is compiler specific or not.

 

The missing functions are just that: missing functions.

 

Switching compiler won't change it.  He'd need to switch standard libraries.

 

Most of the functions he listed are wrappers to corresponding C-language functions.  Even if you couldn't wrap the functions, they would be easy enough to implement using C++-only features.


Check out my personal indie blog at bryanwagstaff.com.

#8 Cornstalks   Crossbones+   -  Reputation: 6974

Like
0Likes
Like

Posted 02 April 2013 - 11:56 AM

Have you tried using the clang compiler? I'm curious if this is compiler specific or not.

 

The missing functions are just that: missing functions.

 

Switching compiler won't change it.  He'd need to switch standard libraries.

I wasn't sure if compilers bundled their own standard libraries (I figured they did, but that could be wrong), and switching compilers would switch standard libraries. Never mind, then.


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS