From owner-freebsd-ports@FreeBSD.ORG Wed May 28 23:32:07 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4C58243 for ; Wed, 28 May 2014 23:32:07 +0000 (UTC) Received: from sdf.lonestar.org (mx.sdf.org [192.94.73.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx.sdf.org", Issuer "SDF.ORG" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD2821FE for ; Wed, 28 May 2014 23:32:06 +0000 (UTC) Received: from sdf.org (IDENT:hhh@sdf.lonestar.org [192.94.73.15]) by sdf.lonestar.org (8.14.8/8.14.5) with ESMTP id s4SNVVAm024895 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO) for ; Wed, 28 May 2014 23:31:31 GMT Received: (from hhh@localhost) by sdf.org (8.14.8/8.12.8/Submit) id s4SNVVhu019488 for freebsd-ports@freebsd.org; Wed, 28 May 2014 23:31:31 GMT From: hhh@sdf.org To: Subject: g++ cannot find std::stoi Date: Thu, 29 May 2014 01:31:52 +0200 Message-ID: <874n09tr87.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 23:32:07 -0000 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 #include using namespace std; int main(){ string theAnswer = "42"; int ans = std::stoi(theAnswer, 0, 10); cout << "The answer to everything is " << ans << endl; }