Xcode 中的控制台应用程序没有输出 [英] No output for console application in Xcode

查看:35
本文介绍了Xcode 中的控制台应用程序没有输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过 Xcode 中的 Qt 控制台应用程序加载图像时,一切正常,我可以在输出中看到我的图像:

When I'm trying to load an image via Qt console application in Xcode everything ok, I can see my image in output:

Mat img = imread( "/Users/.../box.png", CV_LOAD_IMAGE_GRAYSCALE );
imshow( "Source Image", img );

但是如果我尝试输出文本:

But if I try to output text:

std::cout << "Cannot load image" << " ";

输出中没有任何内容,即我看不到终端窗口或其他输出控制台.我该如何解决?

there is nothing in output, I.e. I can't see the terminal window or another output console. How can I fix it?

推荐答案

cout 通常是行缓冲的 - 添加一个 std::endl:

cout is typically line-buffered - add a std::endl:

std::cout << "Cannot load image" << std::endl;

这篇关于Xcode 中的控制台应用程序没有输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆