I know this is an old question, but I encountered a similar issue with Eclipse Neon ( v4.6.0 ) on Ubuntu 16.04 LTS
My code was:
stringstream l_Buffer;
l_Buffer << "test" << endl;
const char* l_Temp = l_Buffer.str().c_str();
eclipse reported 3 errors:
- Invalid overload of 'endl'
- Method 'c_str' could not be resolved
- Method 'str' could not be resolved
I tried a bunch of stuff, rebuilding the index, messing around with the Code Analysis tool (configuring it the same way as my build), and writing std::endl
... All to no avail.
The thing that fixed all three errors in my case was by replacing
stringstream l_Buffer;
with:
basic_stringstream<char> l_Buffer;
Note: Ctrl + Clicking stringstream
leads you to its typedef definition in iosfwd.h
which is:
/// Class for @c char mixed input and output memory streams.
typedef basic_stringstream<char> stringstream;