简体   繁体   English

C ++程序不会在Xcode中打印为cout

[英]C++ program won't print to cout in Xcode

I've never had trouble before, but my current C++/Xcode (7.0.1 on El Capitan) project refuses to print anything to cout (or cerr)--even a simple "Hello" (with endl) as the first line in the main program. 我以前从来没有遇到过麻烦,但是我当前的C ++ / Xcode(El Capitan上的7.0.1)项目拒绝打印任何要打印(或cerr)的内容-即使是简单的“ Hello”(带有endl)作为第一行主程序。

The debugger indicates that the program is running, it's just not outputting anything. 调试器表明程序正在运行,只是没有输出任何东西。 It compiles and builds with no errors. 它可以毫无错误地进行编译和构建。

I tried creating a new "Hello, world" project and it works, and all my old projects work, so what could explain this one's failure? 我尝试创建一个新的“ Hello,world”项目,该项目可以正常运行,并且所有旧项目都可以正常工作,那么有什么可以解释这个失败的原因?

尝试使用激活控制台命令:Cmd + Shift + C或在菜单中:视图,调试区域,激活控制台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM