OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000747OMNeT++simulation kernelpublic2014-03-22 01:242014-10-03 09:56
paolinux 
rhornig 
normalminoralways
resolvedfixed 
4.4.1 
4.6 
0000747: std::to_string method is not available using g++ for Windows (C++11)
Hi there,

I've tried to compile my project code using g++ with the -std=c++11 option from with the mingw shell and it fails with the following error:

omnetpp-4.4.1/include/simutil.h: In function 'std::string double_to_str(double)':
omnetpp-4.4.1/include/simutil.h:366:11: error: 'to_string' is not a member of 'std'

This seems to be a well-known bug in Mingw

http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-so-g [^]

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015 [^]

I wrote a quick patch to solve this (attached below), which simply replace the call to to_string with an ostringstream, but I guess there are cleaner ways to fix this.

Thanks,
P.
No tags attached.
patch to_string.patch (888) 2014-03-22 01:24
https://dev.omnetpp.org/bugs/file_download.php?file_id=136&type=bug
Issue History
2014-03-22 01:24paolinuxNew Issue
2014-03-22 01:24paolinuxFile Added: to_string.patch
2014-10-03 09:56rhornigNote Added: 0000935
2014-10-03 09:56rhornigStatusnew => resolved
2014-10-03 09:56rhornigFixed in Version => 4.6
2014-10-03 09:56rhornigResolutionopen => fixed
2014-10-03 09:56rhornigAssigned To => rhornig

Notes
(0000935)
rhornig   
2014-10-03 09:56   
OMNeT++ 4.6 now compiles in C++11 mode.