0
votes

I am debugging a program that I have built. The program compiles and runs without error.

When using the debugger gcc4.9.3 (rtools_34) I get a message:

'No source available for "std::ostream::operator<<()"'

When stepping over any lines that contain std::cout << "Text" << std::endl; This causes the debugging to crash. However if I set a breakpoint past the rogue code I can skip it without problem.

The code includes: iostream, ostream and string.

This code has also been debugged with other compilers without this issue. It is a new import into Eclipse for a newer compiler so I am assuming that I have set things up wrong.

The problem appears to be with std::endl as using '\n' instead works.

Any hints on interpretation of the error message or how to resolve the problem greatly appreciated.

1
What happens if you replace "Text" with a std::string? It seems like the compiler is unable to convert the literal into a type that is <<-able. Replacing the literal with an explicit instance of a std::string might give you another clue. - Ben
Do you mean to include: std::string test = "Text"; std::cout << test << std::endl; if so then the error is the same. - haffamoto
I have encounter the same issue. did you manage to fix it? see stackoverflow.com/questions/43020983/… - drorbr
No solution so far. I was using breakpoints to bypass the problem. Let me know if you find a solution. I'm currently working on something else but will update if I find a solution. - haffamoto

1 Answers

0
votes

Have you remembered to #include <string>?

Sorry if that was obvious and has been checked, it just wasn't clear that that was definitely the case from your question!