You may encounter the following errors when compiling an open C/C++ application:

..//..//..//..//Symbian//9.1//S60_3rd_MR//EPOC32//include//stdapis//stlport/stl/_sstream.c: In member function `std::streamsize std::basic_stringbuf<_CharT, _Traits, _Allocator>::xsputn(const _CharT*, std::streamsize) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]‘:
..\\src\\Iostream_ex.cpp:149:   instantiated from here
..//..//..//..//Symbian//9.1//S60_3rd_MR//EPOC32//include//stdapis//stlport/stl/_sstream.c:260: warning: comparison between signed and unsigned integer expressions
..//..//..//..//Symbian//9.1//S60_3rd_MR//EPOC32//include//stdapis//stlport/stl/_sstream.c: In member function `std::streamsize std::basic_stringbuf<_CharT, _Traits, _Allocator>::_M_xsputnc(_CharT, std::streamsize) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]‘:
..\\src\\Iostream_ex.cpp:149:   instantiated from here
..//..//..//..//Symbian//9.1//S60_3rd_MR//EPOC32//include//stdapis//stlport/stl/_sstream.c:326: warning: comparison between signed and unsigned integer expressions

How to reproduce the above error?

Include <sstream> file in your project, and then declare an ostringstream variable somewhere and compile the project.

How to fix it?

To fix it, just open stdapis/stlport/stl/_sstream.c. Find and replace the following code line:

if((_M_str.size() - _M_str._M_stream_pos) >= __n)

into

if((_M_str.size() - _M_str._M_stream_pos) >= (size_t)__n)

That’s it!

Tags: , , ,

One Response to ““instantiated from here” Error in OpenC/C++ apps”

  1. Thanks , I have also met this problem and used your method to solve it .

Leave a Reply