问题描述:

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.

网友答案:

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!

相关阅读:
Top