Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved cout in qtcreator

    General and Desktop
    5
    5
    521
    Loading More Posts
    • 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
      s002wjh last edited by

      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.

      JonB ODБOï kshegunov 3 Replies Last reply Reply Quote 0
      • JonB
        JonB @s002wjh last edited by JonB

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

        1 Reply Last reply Reply Quote 1
        • ODБOï
          ODБOï @s002wjh last edited by

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

          1 Reply Last reply Reply Quote 0
          • kshegunov
            kshegunov Moderators @s002wjh last edited by

            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 Reply Quote 1
            • Kent-Dorfman
              Kent-Dorfman last edited by

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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post