QXcbConnection: Could not connect to display - exit code 6, idea ?

Hi,

i have a simple main program which is bound to a shared library i wrote.
Sahred lib is an xml parser based on some Qt's stuff. (console only)
Shared lib is based on Qt 5.*

I cannot start this program within IDE via Run/Debug Configurations

here is console output from CLion
-------
/cppDev/genericEngine/bin/qtHello5Main xml.query --file /cppDev/genericEngine-data/xml/replay/ocd.xml --query /Modules/Video
QXcbConnection: Could not connect to display


Process finished with exit code 6

------------------------------------------------------------------------------------
from bash output with same parameter everything goes like expected
---------------------------------------------------------------------------------------
iface@sony:/cppDev/genericEngine/bin$ ll
total 416
drwxrwxr-x  2 iface iface   4096 Feb 19 22:17 ./
drwxrwxr-x 10 iface iface   4096 Feb 15 13:52 ../
-rwxrwxr-x  1 iface iface  18951 Feb 19 22:17 genRun*
-rwxrwxr-x  1 iface iface 394404 Feb 19 22:15 qtHello5Main*

iface@sony:/cppDev/genericEngine/bin$ ./qtHello5Main xml.query --file /cppDev/genericEngine-data/xml/replay/ocd.xml --query /OCD/Config/Modules/Video
[000000] [20:02:27,781713] [0x7fed7780] Kernel::Kernel
[000001] [20:02:27,782339] [0x7fed7780] program './qtHello5Main' - pid:3830
[000002] [20:02:27,782396] [0x7fed7780] executing test 'xml.query'
[000003] [20:02:27,782429] [0x7fed7780] --------------------------------------------------------------------------------
[000004] [20:02:27,782470] [0x7fed7780] GenXML::parseFile, '/cppDev/genericEngine-data/xml/replay/ocd.xml'
[000005] [20:02:27,782927] [0x7fed7780] GenXML::parseFile, '/cppDev/genericEngine-data/xml/replay/sub/replay.xml'
[000006] [20:02:27,783359] [0x7fed7780] key:MYFILE
[000007] [20:02:27,783389] [0x7fed7780] strVal:
[000008] [20:02:27,783419] [0x7fed7780] GenXML::parseFile, DOLLAR signes where not resolved!
[000009] [20:02:27,784581] [0x7fed7780] --------------------------------------------------------------------------------
[000010] [20:02:27,784644] [0x7fed7780] GenXML::query
[000011] [20:02:27,784680] [0x7fed7780] --------------------------------------------------------------------------------
[000012] [20:02:27,784717] [0x7fed7780] Video{dllPath:ocd_video.dll, iniFile:sub\OCD_VIDEO.INI, load:0, name:video1, verbose:1} [0]
[000013] [20:02:27,784742] [0x7fed7780] --------------------------------------------------------------------------------
[000014] [20:02:27,784771] [0x7fed7780]
[000015] [20:02:27,784792] [0x7fed7780] ******************************************************
[000016] [20:02:27,784812] [0x7fed7780] *** xml.query executed in 161 milliseconds
[000017] [20:02:27,784848] [0x7fed7780] ******************************************************
[000018] [20:02:27,784872] [0x7fed7780] Kernel::~Kernel
iface@sony:/cppDev/genericEngine/bin$
---------------------------------------------------------------------------------------------------------
Calling qtHello5Main within IDE as Tools work - but i don't want to create external tool config for some targtets.

...Could not connect to disply sounds strange .... but i do not make explicite calls.

And last not least call as External Tool or directly from bash works always.

Greetings Olaf

2 comments
Comment actions Permalink

Perhaps, the framework tries to connect to X Server implicitly, behind the scenes. You need to pass the DISPLAY environment variable to the process. In the "Edit configurations" press "..." button near "Environment variables" field add DISPLAY with the value that you can find by executing "print $DISPLAY" in the console. Alternatively, you can try to just set the "Include parent environment variables" checkbox.

0
Comment actions Permalink

Hi Vyacheslav,

thank you for fast response and help.
YES - "Include parent environment variables" checkbox was a working solution.
I learned now, that CLion behaves a little bit different.
I expected CLion to use my environment like it is by default.
Like other programs do. Filemanagers, shells, etc.
Nevertheless its working now.

I recommend not to hide this important information.
One level higher would be better - Under the line "Environment Variables" -  that everyone can see this directly.
Now i have to open an extra Dialog to revert environment handling back into normal behaviour.

Greetings Olaf

0

Please sign in to leave a comment.