Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Jun 2014 15:49:32 +0200
From:      hhh@sdf.org
To:        Lowell Gilbert <freebsd-ports-local@be-well.ilk.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: g++ cannot find std::stoi
Message-ID:  <87fvjnifpv.fsf@gmail.com>
In-Reply-To: <44k3942y0w.fsf@be-well.ilk.org>
References:  <874n09tr87.fsf@gmail.com> <44k3942y0w.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Lowell Gilbert <freebsd-ports-local@be-well.ilk.org> writes:

> 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.

I tried with gcc49 and it seem to have the same problem.


> The default compiler on recent (I think 10.0 and up) is a version of
> clang that will get this right.

Unfortunately, OpenCog has some gcc specific code.


Do you have other ideas?

Thank you!
Henryk



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