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. QXcbConnection could not connt to display, cygwin

QXcbConnection could not connt to display, cygwin

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++qt5cygwin
5 Posts 3 Posters 7.1k Views 2 Watching
  • 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.
  • Z Offline
    Z Offline
    zero9178
    wrote on last edited by
    #1

    Hello everyone,

    I am using the newest release of cygwin on Windows 10 CLion (aka CMake build system) using the Qt5 version shipped with the newest version of cygwin. Everything works great including moc and etc but as soon as I am trying to run the Program it crashes at the first line which is a call to the default QApplication constructor. The error message in the console is:

    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-User'
    qt.qpa.screen: QXcbConnection: Could not connect to display
    Could not connect to any X display.

    Thanks in Advance!

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

      Hi and welcome to devnet,

      AFAIK you have to start an X server before you can run such an application with Cygwin.

      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
      1
      • Z Offline
        Z Offline
        zero9178
        wrote on last edited by
        #3

        I am not quite sure if I am doing it right, but I started the X server using startxwin inside of the Cygwin terminal and then exported the Display with export DISPLAY=0.0, but starting the Qt application afterwards resulted in the same error. I am sorry that I am quite new to this!

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

          IIRC, it should be DISPLAY=:0.0

          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
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #5

            Hi
            Just as note.
            You should do it in same shell
            (start x server)
            export DISPLAY=:0.0; /path/app

            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