<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[std::cout calls are eaten by Qt (nothing printed)]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I am experimenting with VulkanSceneGraph (a graphical library based on VulkanSDK ) and found a nice example with Qt integration. However, in the application, std::cout calls don't print anything at all. Maybe std::cout and std::cerr are redirected to somewhere by Qt, I don't know.<br />
How can I activate std::cout calls in Qt?<br />
All solutions that I found so far suggest enabling a flag in qmake file: <strong>CONFIG += console</strong>, but this project is CMake project.</p>
<p dir="auto">VulkanSDK Qt example repo:<br />
<a href="https://github.com/vsg-dev/vsgQt" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/vsg-dev/vsgQt</a><br />
Related issue:<br />
<a href="https://github.com/vsg-dev/vsgQt/issues/35" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/vsg-dev/vsgQt/issues/35</a></p>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.qt.io/topic/156300/std-cout-calls-are-eaten-by-qt-nothing-printed</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 20:22:27 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/156300.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Apr 2024 09:55:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::cout calls are eaten by Qt (nothing printed) on Thu, 25 Apr 2024 11:08:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mubin">@<bdi>Mubin</bdi></a> said in <a href="/post/797981">std::cout calls are eaten by Qt (nothing printed)</a>:</p>
<blockquote>
<p dir="auto">Even after creating QApplication until return application.exec(); it should print to console?</p>
</blockquote>
<p dir="auto">No, that's a <a href="https://cmake.org/cmake/help/latest/command/add_executable.html#add-executable" target="_blank" rel="noopener noreferrer nofollow ugc">property</a> (WIN32) of the executable and has nothing to do with Qt</p>
]]></description><link>https://forum.qt.io/post/797983</link><guid isPermaLink="true">https://forum.qt.io/post/797983</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Thu, 25 Apr 2024 11:08:46 GMT</pubDate></item><item><title><![CDATA[Reply to std::cout calls are eaten by Qt (nothing printed) on Thu, 25 Apr 2024 12:59:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mubin">@<bdi>Mubin</bdi></a> That's whats the cmake property I linked is doing, yes.</p>
]]></description><link>https://forum.qt.io/post/798002</link><guid isPermaLink="true">https://forum.qt.io/post/798002</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Thu, 25 Apr 2024 12:59:50 GMT</pubDate></item><item><title><![CDATA[Reply to std::cout calls are eaten by Qt (nothing printed) on Thu, 25 Apr 2024 12:49:13 GMT]]></title><description><![CDATA[<p dir="auto">Ok, I solved the problem.<br />
In Visual Studio, I changed the properties of the project.<br />
<strong>Properties -&gt; Linker -&gt; System -&gt; SubSystem</strong> was set to <strong>Windows /SUBSYSTEM:WINDOWS)</strong>, I set it to <strong>Console (/SUBSYSTEM:CONSOLE)</strong>. It prints cout to the console now.<br />
<strong>Windows /SUBSYSTEM:WINDOWS)</strong> expects <code>WinMain()</code> instead of <code>main()</code>.</p>
]]></description><link>https://forum.qt.io/post/798000</link><guid isPermaLink="true">https://forum.qt.io/post/798000</guid><dc:creator><![CDATA[Mubin]]></dc:creator><pubDate>Thu, 25 Apr 2024 12:49:13 GMT</pubDate></item><item><title><![CDATA[Reply to std::cout calls are eaten by Qt (nothing printed) on Thu, 25 Apr 2024 11:08:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mubin">@<bdi>Mubin</bdi></a> said in <a href="/post/797981">std::cout calls are eaten by Qt (nothing printed)</a>:</p>
<blockquote>
<p dir="auto">Even after creating QApplication until return application.exec(); it should print to console?</p>
</blockquote>
<p dir="auto">No, that's a <a href="https://cmake.org/cmake/help/latest/command/add_executable.html#add-executable" target="_blank" rel="noopener noreferrer nofollow ugc">property</a> (WIN32) of the executable and has nothing to do with Qt</p>
]]></description><link>https://forum.qt.io/post/797983</link><guid isPermaLink="true">https://forum.qt.io/post/797983</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Thu, 25 Apr 2024 11:08:46 GMT</pubDate></item><item><title><![CDATA[Reply to std::cout calls are eaten by Qt (nothing printed) on Thu, 25 Apr 2024 11:04:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a><br />
Yes it is a GUI program but before creating <code>QApplication</code>, <code>std:cout</code> should print to the console, right?</p>
<p dir="auto">For example I am adding a <code>std::cout</code> at this line: <a href="https://github.com/vsg-dev/vsgQt/blob/master/examples/vsgqtviewer/main.cpp#L76" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/vsg-dev/vsgQt/blob/master/examples/vsgqtviewer/main.cpp#L76</a></p>
<p dir="auto">Even after creating <code>QApplication</code> until <code>return application.exec();</code> it should print to console?</p>
<p dir="auto">When I run the program without any parameter, the error text at line <a href="https://github.com/vsg-dev/vsgQt/blob/master/examples/vsgqtviewer/main.cpp#L117" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/vsg-dev/vsgQt/blob/master/examples/vsgqtviewer/main.cpp#L117</a> should print the error, right?</p>
]]></description><link>https://forum.qt.io/post/797981</link><guid isPermaLink="true">https://forum.qt.io/post/797981</guid><dc:creator><![CDATA[Mubin]]></dc:creator><pubDate>Thu, 25 Apr 2024 11:04:45 GMT</pubDate></item><item><title><![CDATA[Reply to std::cout calls are eaten by Qt (nothing printed) on Thu, 25 Apr 2024 10:44:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mubin">@<bdi>Mubin</bdi></a><br />
Where do youm expect <code>std::cout</code> output to go, since I presume you have a GUI program?  You might find them in <strong>Creator</strong>'s "Output" window, but they are not going to go anywhere the user can see.  If you want that you will want a "console" application, not a GUI one.</p>
]]></description><link>https://forum.qt.io/post/797977</link><guid isPermaLink="true">https://forum.qt.io/post/797977</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 25 Apr 2024 10:44:39 GMT</pubDate></item></channel></rss>