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]Qt error at Mac OS X: Cannot start the terminal emulator 'xterm'.
QtWS25 Last Chance

[Solved]Qt error at Mac OS X: Cannot start the terminal emulator 'xterm'.

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 16.3k 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.
  • S Offline
    S Offline
    szuzsq
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        szuzsq
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • U Offline
          U Offline
          uranusjr
          wrote on last edited by
          #4

          Just put in
          @/Applications/Utilities/Terminal.app@
          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
          @/usr/X11/bin/xterm -e@
          also works (by launching the X11 terminal).

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tobias.hunger
            wrote on last edited by
            #5

            Could you guys please file that as a bug report? That should work out of the box IMHO.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              szuzsq
              wrote on last edited by
              #6

              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:
              1).
              Last login: Wed Sep 21 15:34:38 on ttys002
              rene-mac:~ mike$ /Volumes/Mac_OS_4/test/test/test ; exit;
              hello

              2).
              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
              logout

              [Process completed]

              3).
              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
              logout

              [Process completed]

              4).
              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.
              logout

              [Process completed]

              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:
              @
              //main.cpp
              #include <QtCore/QCoreApplication>

              int main(int argc, char *argv[])
              {
              QCoreApplication a(argc, argv);

              printf("hello\n");
              return a.exec&#40;&#41;;
              

              }
              @

              when I try to comment some statement, as result below:
              @
              //QCoreApplication a(argc, argv);

              printf("hello\n");
              return 0;
              //return a.exec&#40;&#41;;
              

              @

              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?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                szuzsq
                wrote on last edited by
                #7

                I mean why invoke statement
                @
                QCoreApplication a(argc, argv);
                return a.exec();
                @

                bring this error when using "/usr/X11/bin/xterm -e"

                1 Reply Last reply
                0
                • U Offline
                  U Offline
                  uranusjr
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    deleted487
                    wrote on last edited by
                    #9

                    the bug report was created by szuzsq
                    https://bugreports.qt.nokia.com/browse/QTCREATORBUG-6150

                    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