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

Alex Afanasyev cawka1 at gmail.com
Mon Dec 10 14:49:30 PST 2018


There shouldn't be a problem with to_string on 16.04...  I suggest you drop std::   ndn-cxx library has a few workarounds for missing methods, so it may work better this way  (I'm assuming you are within ndn:: namespace, otherwise try ndn::to_string).

-
Alex

> On Dec 10, 2018, at 5:47 PM, John Baugh <jpbaugh at umich.edu <mailto:jpbaugh at umich.edu>> wrote:
> 
> 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 <mailto: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 <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 <mailto: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 <mailto: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 <mailto:ndnSIM at lists.cs.ucla.edu>
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim <http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu <mailto: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/d25eec0c/attachment-0001.html>


More information about the ndnSIM mailing list