g++ cannot find std::stoi

hhh at sdf.org hhh at sdf.org
Mon Jun 2 13:49:45 UTC 2014


Lowell Gilbert <freebsd-ports-local at be-well.ilk.org> writes:

> hhh at 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


More information about the freebsd-ports mailing list