[Solved]Qt error at Mac OS X: Cannot start the terminal emulator 'xterm'.
I use Qt at Mac OS X(Qt_SDK_Mac64_offline_v1_1_3_en.dmg);
My problem is as below:
I create a new "Qt Console Application", compile and build it;
but, when I run it in debug mode, it appear a message:
"Cannot start the terminal emulator 'xterm'."
How can I resolve it? Is anyone can help me?
Either install xterm or configure Qt Creator to use the Mac terminal in Tools->Options->Environment.
I wonder why the later had not happened in the image. You might want to consider "filing a bug":http://bugreports.qt.nokia.com/ report against the Qt SDK to get that fixed in the next version.
Thx for the last reply.
I have considered filing a bug [bugreports.qt.nokia.com] report against the Qt SDK,
and fixed my problem under your suggestion: install xterm.
After installing, I configure "Tools->Options->Environment":
form "xterm -e" as default,
to "/usr/local/xterm -e".
BTW, how to configure Qt Creator to use the Mac terminal in Tools->Options->Environment?
I have tried "sh -e", "ash -e", "bash -e", but all are invalid.
Just put in
which is the default path of Terminal in Mac OS X.
By the way, Mac OS X does have xterm built-in, just not in its default PATH. Using
also works (by launching the X11 terminal).
Could you guys please file that as a bug report? That should work out of the box IMHO.
I have tried these different two way.
1:====when I put in "/Applications/Utilities/Terminal.app",
and then run debug model,it appear 4 terminal window:
Last login: Wed Sep 21 15:34:38 on ttys002
rene-mac:~ mike$ /Volumes/Mac_OS_4/test/test/test ; exit;
Last login: Wed Sep 21 15:34:38 on ttys001
rene-mac:~ mike$ /Volumes/Mac_OS_4/test/test ; exit;
-bash: /Volumes/Mac_OS_4/test/test: is a directory
Last login: Wed Sep 21 15:34:38 on ttys000
rene-mac:~ mike$ /var/folders/Vc/VcNYECwgEOuL5wCCeLqh1++++TI/-Tmp-/qt_temp.ux4229/stub-socket ; exit;
-bash: /var/folders/Vc/VcNYECwgEOuL5wCCeLqh1++++TI/-Tmp-/qt_temp.ux4229/stub-socket: Permission denied
Last login: Wed Sep 21 15:34:11 on ttys003
rene-mac:~ mike$ /Users/mike/Qt/Qt\ Creator.app/Contents/Resources/qtcreator_process_stub ; exit;
This is an internal helper of Qt Creator. Do not run it manually.
it look like work well, but way happen to so much windows?
2:====when I put in "/usr/X11/bin/xterm -e",
and then run debug mode,it work well,
but when I try to close the window(click the "X" button at the left, top scope),
it appear a error dialog as below:
the inferior stopped because it received a signal from the Operating system.
Signal name: SIGHUP
Signal meaning: Hangup
My code is so simple:
int main(int argc, char *argv)
QCoreApplication a(argc, argv);
printf("hello\n"); return a.exec();
when I try to comment some statement, as result below:
//QCoreApplication a(argc, argv);
printf("hello\n"); return 0; //return a.exec();
it work well and the error dialog will never appear
My test.pro file is:
QT += core
QT -= gui
TARGET = test
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
how can I resolve this problem?
I mean why invoke statement
QCoreApplication a(argc, argv);
bring this error when using "/usr/X11/bin/xterm -e"
The error in xterm is not caused by your application, but your clicking on "X" button.
QCoreApplication enters its event loop when you run a.exec(), and the application keeps running nonstop. When you click "X," the OS tries to terminate xterm by sending a termination signal. When xterm quits, it finds that you have a running program, so it pops that dialog to tell you that it has to terminate that program because the OS wants it to. It's not a problem, and you can ignore it.
I don't have your problem with Terminal.app either building applications in debug or release mode using a custom-built Qt 4.7.4 with Qt Creator 2.3.0 (on Mac OS X 10.7.1). The content in your first window is correct, obviously. But Qt Creator tries to launch some other things in your case. Sorry, but I'm as much in the dark as you are.
the bug report was created by szuzsq