Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. cout in qtcreator
Qt 6.11 is out! See what's new in the release blog

cout in qtcreator

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 5 Posters 1.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    s002wjh
    wrote on last edited by
    #1

    how to get cout <<"test"<<endl working in qtcreator? I know I can use qdebug, but I couldn't never get the qdebug work in Linux terminal except cout.

    JonBJ ODБOïO kshegunovK 3 Replies Last reply
    0
    • S s002wjh

      how to get cout <<"test"<<endl working in qtcreator? I know I can use qdebug, but I couldn't never get the qdebug work in Linux terminal except cout.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @s002wjh
      Isn't there an Application Output window in Qt Creator? Are you compiling/linking/configured as a console application?

      1 Reply Last reply
      1
      • S s002wjh

        how to get cout <<"test"<<endl working in qtcreator? I know I can use qdebug, but I couldn't never get the qdebug work in Linux terminal except cout.

        ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on last edited by
        #3

        @s002wjh maybe silly question but did you #include <iostream> ?

        1 Reply Last reply
        0
        • S s002wjh

          how to get cout <<"test"<<endl working in qtcreator? I know I can use qdebug, but I couldn't never get the qdebug work in Linux terminal except cout.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          The Qt way of doing this is:

          QTextStream out(stdout);
          out << "something";
          

          However you should also be able to use the standard means (i.e. cout).

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          1
          • Kent-DorfmanK Offline
            Kent-DorfmanK Offline
            Kent-Dorfman
            wrote on last edited by
            #5

            and of course OP needs to reference the std namespace where cout lives.

            The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved