From owner-freebsd-ports@FreeBSD.ORG Thu May 29 19:19:33 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 CDED52F0 for ; Thu, 29 May 2014 19:19:33 +0000 (UTC) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id A9FE72DF4 for ; Thu, 29 May 2014 19:19:33 +0000 (UTC) Received: by be-well.ilk.org (Postfix, from userid 1147) id 62C9733C48; Thu, 29 May 2014 15:19:27 -0400 (EDT) From: Lowell Gilbert To: hhh@sdf.org Subject: Re: g++ cannot find std::stoi References: <874n09tr87.fsf@gmail.com> Reply-To: Date: Thu, 29 May 2014 15:19:27 -0400 In-Reply-To: <874n09tr87.fsf@gmail.com> (hhh@sdf.org's message of "Thu, 29 May 2014 01:31:52 +0200") Message-ID: <44k3942y0w.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-ports@freebsd.org 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: Thu, 29 May 2014 19:19:33 -0000 hhh@sdf.org writes: > 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? An old libc++ bug in gcc. You need a newer compiler. The default compiler on recent (I think 10.0 and up) is a version of clang that will get this right.