Qt Forum

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

    Forum Updated on Feb 6th

    Unsolved qt cmdline app does not launch on mac OS X 10.14.6

    Tools
    3
    11
    398
    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.
    • ademmler
      ademmler last edited by

      Hi there,

      1. A simple qt cmdline app does not launch on mac OS X 10.14.6.
      2. Launch process is slow.
      3. When I go to finder and launch the executable form there all is fine.

      Terminal says:
      Last login: Wed Aug 19 12:22:34 on ttys000
      /var/folders/8t/qzzv_8h50y70jlpgyl14v28c0000gn/T/tmpmh8lOZ ; exit;
      rocket:~ ademmler$ /var/folders/8t/qzzv_8h50y70jlpgyl14v28c0000gn/T/tmpmh8lOZ ;
      exit;
      Cannot connect creator comm socket /private/var/folders/8t/qzzv_8h50y70jlpgyl14v28c0000gn/T/QtCreator.gfveRr/stub-socket: No such file or directory
      Press <RETURN> to close this window...

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Do you have any custom stuff done when starting a command line session ?

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

        ademmler 1 Reply Last reply Reply Quote 0
        • ademmler
          ademmler @SGaist last edited by

          @SGaist No - I think not.

          I made a minimal app - for another thread here. Thats how I noticed this.
          you may remember I was reporting this earlier this year in another thread.

          How can i measure the time needed from "launch in qt" until the console window pops up?
          Why does is lose its socket?

          Regards Alexander

          Here is the code

          #include <QCoreApplication>
          #include <QStandardPaths>
          #include <QDir>
          #include <QDebug>
          #include <QElapsedTimer>
          
          void exitApp(int r){
              QCoreApplication::exit(r);
          }
          
          int main(int argc, char *argv[])
          {
              QCoreApplication a(argc, argv);
          
          
              QElapsedTimer timer;
              timer.start();
          
              qDebug() << "QDir::separator = " << QString(QDir::separator()) << Qt::endl;
              qDebug() << "QStandardPaths::DesktopLocation = " << QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) << Qt::endl;
          
          //    QDir resourcesPath(QCoreApplication::applicationDirPath());
          //    resourcesPath.cd("../Resources/test");
          
          //    qDebug() << "QCoreApplication::applicationDirPath() = " << resourcesPath << Qt::endl;
          
              QDir mydir = QDir(QCoreApplication::applicationDirPath());
          
              qDebug() << "That is mydir: " << mydir;
              qDebug() << "Change dir: " << mydir.cd("Resources/test me");
              qDebug() << "Path: " << mydir.currentPath();    
              qDebug() << "Content: " << mydir.entryList();
          
              qDebug() << "Timer: " << timer.elapsed();
          
              return a.exec();
          }
          
          JonB 1 Reply Last reply Reply Quote 0
          • JonB
            JonB @ademmler last edited by

            @ademmler
            The only thing here which should/might "take some time" is the mydir.entryList(). And I wouldn't expect it to be much. How much elapsed time does your code above show?

            ademmler 1 Reply Last reply Reply Quote 0
            • ademmler
              ademmler @JonB last edited by

              @JonB in the directory - I use for testing - is only one file ;-)

              JonB 1 Reply Last reply Reply Quote 0
              • JonB
                JonB @ademmler last edited by

                @ademmler
                Try this for your program!

                int main(int argc, char *argv[])
                {
                    Q_UNUSED(argc);
                    Q_UNSED(argv);
                    return 0;
                }
                

                How long does this take?

                ademmler 1 Reply Last reply Reply Quote 0
                • ademmler
                  ademmler @JonB last edited by ademmler

                  @JonB

                  It takes 10 seconds until the console appears ... which is way to long ...

                  If I launch the same executable direct in the console it takes:
                  real 0m0.034s
                  user 0m0.010s
                  sys 0m0.008s

                  Last login: Thu Aug 20 10:35:12 on ttys000
                  /var/folders/8t/qzzv_8h50y70jlpgyl14v28c0000gn/T/tmpEIFMX5 ; exit;
                  rocket:~ ademmler$ /var/folders/8t/qzzv_8h50y70jlpgyl14v28c0000gn/T/tmpEIFMX5 ;
                  exit;
                  Cannot connect creator comm socket /private/var/folders/8t/qzzv_8h50y70jlpgyl14v28c0000gn/T/QtCreator.tneJjR/stub-socket: No such file or directory
                  Press <RETURN> to close this window...

                  JonB 1 Reply Last reply Reply Quote 0
                  • JonB
                    JonB @ademmler last edited by

                    @ademmler
                    Yes, and so there is the problem, nothing to do with your actual code. I know nothing about what's going on on Mac I'm afraid. Out of interest, does this only happen when you run for debug from Creator, how is it if you select non-debug run only?

                    ademmler 1 Reply Last reply Reply Quote 0
                    • ademmler
                      ademmler @JonB last edited by ademmler

                      @JonB said in qt cmdline app does not launch on mac OS X 10.14.6:

                      I know nothing about what's going on on Mac I'm afraid
                      You may better first investigate macs, before you answer mac related questions ...

                      This is why I asked @SGaist to help me:
                      From my point of view it is a problem of QtCreator ...
                      After pressing "run" it takes simply to long (10-40 seconds) until the code is executed.
                      And I am not talking about running "debugger"!
                      For development in QtCreator it is mandatory to use build/run/debug in a fast manner ...

                      JonB 1 Reply Last reply Reply Quote 0
                      • JonB
                        JonB @ademmler last edited by

                        @ademmler said in qt cmdline app does not launch on mac OS X 10.14.6:

                        You may better first investigate macs, before you answer mac related questions ...

                        That appears to be your comment. I have tried to help you all over the place with your various questions. In view of your reaction, I will cease to do so from now on for any of your questions.

                        So far as I am concerned, this is very rude to someone who chooses to spend time looking at others' questions. I was going to investigate this further for you, but certainly will not do so now. Good luck in choosing who you want to answer what. Bye.

                        ademmler 1 Reply Last reply Reply Quote 1
                        • ademmler
                          ademmler @JonB last edited by ademmler

                          @JonB
                          Forgive me please for being the reason for your troubles.
                          As I always have been thank full to you - your advices and comments made me feel like an idiot.
                          Ofcourse I always first search in the documentation, than the web for a working sample.

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