【发布时间】:2014-12-31 22:49:53
【问题描述】:
我正在开发一个非托管 C++11 应用程序并在 VS2013 中对其进行调试。我有一个助手类
#include <cstdio>
class DebugHelper : public dbg::IDebugHelper {
public:
virtual void outputLine(const std::string & message) const override
{ std::cout << message << std::endl; }
.....
};
我希望通过 DebugHelper 的 outputLine 打印的字符串会显示在工作室的输出窗口中。然而,std::cout 和 std::err 都没有发生这种情况。它应该吗?我缺少的项目属性中是否有某种设置?顺便说一句,相同的代码在 QtCreator 下的 Mac 上按预期工作。
【问题讨论】:
-
类中的一行代码并不能真正证明您正在输出任何东西。向我们展示演示该问题的程序。编辑:如果是调试窗口,则需要使用
OutputDebugString或TRACE宏。
标签: c++ c++11 visual-studio-2013