Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 May 2014 01:31:52 +0200
From:      hhh@sdf.org
To:        <freebsd-ports@freebsd.org>
Subject:   g++ cannot find std::stoi
Message-ID:  <874n09tr87.fsf@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I'm trying to compile OpenCog [1] using g++47, but get an error about
missing std::stoi.

I have attached a micro-example [2] that generates the same error, if I
try to compile it with:

% g++47 -std=c++11 s.cc
s.cc: In function 'int main()':
s.cc:8:13: error: 'stoi' is not a member of 'std'


There are no problems neither with clang nor with g++ on Debian:

% clang++ -std=c++11 s.cc



What am I missing?


Henryk




[1] http://opencog.org/
[2] cat s.cc

#include <iostream>
#include <string>

using namespace std;

int main(){
  string theAnswer = "42";
  int ans = std::stoi(theAnswer, 0, 10);

  cout << "The answer to everything is " << ans << endl;
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?874n09tr87.fsf>