【问题标题】:C++ linux debug trace not coming outC++ linux调试跟踪没有出来
【发布时间】:2014-06-30 15:59:40
【问题描述】:

下面的代码在 Windows 上运行正常,并且跟踪但在 linux 上传输和构建后,窗口上什么也没有出现。这是程序(我现在在跟踪输出之后将所有内容都注释掉了):

int main(int argc, char const* const argv[])
{
     std::cerr << "Hello" << std::endl;
     return 0;
}

我启动了程序,但没有任何结果。它在linux(和windows)上构建没有错误。跟踪出现在 Windows 中,但我在 linux 中什么也没有。

【问题讨论】:

  • 什么是Global::programDescriptionInputError??????
  • Global::programDescription 只是一个字符串。输入错误是这样的(关于在这个框中格式化):class InputError //Exception { private: std::string text;公共: InputError(char const myText[]) : text(myText) {} InputError(std::string const& myText) : text(myText) {} InputError(std::stringstream const& myText) : text(myText.str() ) {} std::string const& Text() const {返回文本;} };
  • 您发布的代码不是有效的 C++。请确保您的代码可复制粘贴到编译器中并编辑您的问题。通常,您会回答自己的问题并尝试生成一个可编译的最小示例。
  • 请展示完整的测试用例。此代码无法编译。
  • 您的程序的最新版本会按预期编译并打印“Hello”。

标签: c++ linux output


【解决方案1】:

这是一个生成文件问题。如果我使用 g++ 编译程序,它可以工作。如果我使用 makefile 它不起作用,尽管它说它已经构建并链接没有错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多