No output for console application in Xcode

2019-07-31 22:59发布

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?

标签: c++ xcode opencv
1条回答
forever°为你锁心
2楼-- · 2019-07-31 23:23

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

std::cout << "Cannot load image" << std::endl;
查看更多
登录 后发表回答