used:
cocos2d-x 3.1
cocos run -p android
error: ‘stof’ was not declared in this scope
use atof is ok.but stof why not work!
used:
cocos2d-x 3.1
cocos run -p android
error: ‘stof’ was not declared in this scope
use atof is ok.but stof why not work!
std::stof
PS. It’s not a Cococ2d-x related problem.
In Android, the error
error: 'stof' is not a member of 'std'
shows up when run build_native.py…
I encountered the same problem with cocos2d-x 3.4, I found a workaround which works on both Android and iOS:
float value = CCString::create(string)->floatValue();