Unsolved qt cmdline app does not launch on mac OS X 10.14.6
-
Hi there,
- A simple qt cmdline app does not launch on mac OS X 10.14.6.
- Launch process is slow.
- 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... -
Hi,
Do you have any custom stuff done when starting a command line session ?
-
@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(); }
-
@ademmler
The only thing here which should/might "take some time" is themydir.entryList()
. And I wouldn't expect it to be much. How much elapsed time does your code above show? -
@JonB in the directory - I use for testing - is only one file ;-)
-
@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?
-
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.008sLast 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... -
@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? -
@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 ... -
@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.
-
@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.