error: QXcbConnection: Could not connect to display

/*********************************************************************************
 *           error: QXcbConnection: Could not connect to display
 * 说明:
 *     调试Qt5支持XCB平台模式的时候遇到的错误。
 *
 *                                              2017-11-28 深圳 南山平山村 曾剑锋
 ********************************************************************************/
    
一、参考文档:
    1. Qt5: QXcbConnection: Could not connect to display Aborted (core dumped)
        http://bbs.csdn.net/topics/391894181

二、Qt支持X11 XCB

     /home/zengjf/zengjf/zengjfos/buildroot-2017.02.3/.config - Buildroot 2017.02.3 C
    o> Target packages > Graphic libraries and applications (graphic/text) > Qt5 ──
      ┌────────────────────────────────── Qt5 ──────────────────────────────────┐
      │  Arrow keys navigate the menu.  <Enter> selects submenus ---> (or empty │  
      │  submenus ----).  Highlighted letters are hotkeys.  Pressing <Y>        │  
      │  selectes a feature, while <N> will exclude a feature.  Press           │  
      │  <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend: [*] feature │  
      │ ┌────^(-)─────────────────────────────────────────────────────────────┐ │  
      │ │    -*-     gui module                                               │ │  
      │ │    -*-       widgets module                                         │ │  
      │ │              *** OpenGL support needs an OpenGL-capable backend *** │ │  
      │ │    [*]       linuxfb support                                        │ │  
      │ │              *** directfb backend available if directfb is enabled *│ │  
      │ │    [*]       X.org XCB support                                      │ │  
      │ │              *** eglfs backend available if OpenGL and EGL are enabl│ │  
      │ │    (xcb)        Default graphical platform                             │ │  
      │ │    [ ]       fontconfig support                                     │ │  
      │ │    [ ]       GIF support                                            │ │  
      │ └────┴(+)─────────────────────────────────────────────────────────────┘ │  
      ├─────────────────────────────────────────────────────────────────────────┤  
      │        <Select>    < Exit >    < Help >    < Save >    < Load >         │  
      └─────────────────────────────────────────────────────────────────────────┘  

三、错误解决方法
    1. Error 1
        1. cmd: ./Helloworld -platform xcb
        2. error: QXcbConnection: Could not connect to display
        3. resolution: export DISPLAY=:0.0

    2. Error 2
        1. cmd: ./Helloworld -platform xcb
        2. error: QXcbConnection: Could not connect to display :0.0
        3. resolution: 检查X11 Server正常运行

 

转载于:https://www.cnblogs.com/zengjfgit/p/7910642.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值