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. [SOLVED] Unable to run OSX code

[SOLVED] Unable to run OSX code

Scheduled Pinned Locked Moved General and Desktop
os xprogramno output
5 Posts 3 Posters 1.9k Views
  • 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.
  • DuncanD Offline
    DuncanD Offline
    Duncan
    wrote on last edited by Duncan
    #1

    Greetings!

    I'm trying to run my first program on QT below and it will not run I get the below output. Need Help!

    #include <QCoreApplication>
    #include <iostream>

    using namespace std;

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);
    cout << "tesT";
    return a.exec();
    }
    Application OUTPUT: Starting /MultimediaOSX/QT/build-LoTQT-Desktop_Qt_5_4_2_clang_64bit-Debug/LoTQT... (it just sits here)

    Terminal OUTPUT: Last login: Wed Jun 17 11:28:13 on ttys000
    JiMac:~ co$ cd /; /MultimediaOSX/QT/Qt\ Creator.app/Contents/MacOS/../Resources/qtcreator_process_stub run /var/folders/fw/lqq81zbd2fnbycx75mq4_gvm0000gn/T/QtCreator.N12263/stub-socket Press\ <RETURN>\ to\ close\ this\ window... /MultimediaOSX/QT/build-LoTQT-Desktop_Qt_5_4_2_clang_64bit-Debug /var/folders/fw/lqq81zbd2fnbycx75mq4_gvm0000gn/T/QtCreator.t12263 12263 /MultimediaOSX/QT/build-LoTQT-Desktop_Qt_5_4_2_clang_64bit-Debug/LoTQT

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      It's behaving as expected. a.exec() starts the event loop, but since you are doing nothing, it will run forever until you kill the application.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • DuncanD Offline
        DuncanD Offline
        Duncan
        wrote on last edited by
        #3

        Thanks for the response!

        Why is it not displaying the below line of code?

        cout << "tesT";

        Thanks for your help,

        Duncan

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          HI and welcome to devnet,

          cout is a buffered stream; it doesn't print the stream until you don't flush (endl flushes)

          try with cout << "Test" << endl;

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          1 Reply Last reply
          0
          • DuncanD Offline
            DuncanD Offline
            Duncan
            wrote on last edited by
            #5

            Thanks for the help all, Im a noob and realized im working in an IDE like Xcode that makes apps.

            I followed this tutorial for good info:

            https://www.youtube.com/watch?v=6KtOzh0StTc

            Thanks again!!

            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