[ndnSIM] to_string is not a member of std error in ndnSIM

John Baugh jpbaugh at umich.edu
Mon Dec 10 14:47:12 PST 2018


Jack

That's not really a fix. That's a workaround.

If you have a newer compiler installed, it should recognize to_string.  You
may be able to simply just upgrade g++ and get it to work.

Thanks

JPB

On Mon, Dec 10, 2018, 5:44 PM Jack Baldasso <jackbaldasso at gmail.com wrote:

> I'm using Ubuntu 16.04 LTS.
> I was able to find a solution on Stack Overflow (
> https://stackoverflow.com/questions/19122574/to-string-isnt-a-member-of-std/19122592).
> I implemented the std::string ToString(T val) and it worked.
>
> #include <string>#include <sstream>
> template <typename T>
> std::string ToString(T val){
>     std::stringstream stream;
>     stream << val;
>     return stream.str();}
>
>
>
>
> On Mon, Dec 10, 2018 at 5:37 PM John Baugh <jpbaugh at umich.edu> wrote:
>
>> What OS are you running and what compiler/version.
>>
>> Thanks
>>
>> John
>>
>> On Mon, Dec 10, 2018, 5:33 PM Jack Baldasso <jackbaldasso at gmail.com
>> wrote:
>>
>>> Hi,
>>>
>>> I deployed a package on ndnSIM 1.0 (this is my baseline scenario where I
>>> will be comparing my approach with), but in my simulation file I have a
>>> statement `std::to_string()` which is giving me the following error:
>>>
>>>     error: ‘to_string’ is not a member of ‘std’
>>>
>>> I couldn't find this issue on the mailing list. How do I fix it?
>>> Basically I just need to convert an integer value into a string.
>>>
>>> Thanks,
>>> Jack
>>>
>>> PS: I'm using ndnSIM 2.6 for my other approach.
>>> _______________________________________________
>>> ndnSIM mailing list
>>> ndnSIM at lists.cs.ucla.edu
>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20181210/9205a18f/attachment.html>


More information about the ndnSIM mailing list