1828586 Members
2429 Online
109982 Solutions
New Discussion

can not display problem

 
satyach
Advisor

can not display problem

Hi

I created the executable by giving following options in Makefile

-Wl,a,archive.

I am getting following error.
Error: Can't open display: HOST ID

I am working on the same machine, where executable created.

I am using HP 11.0 and HP ANSI C++ B3910B A.03.25.

please help me to resolve this problem. which is critical to me.

Thanks
Satya
5 REPLIES 5
Santosh Nair_1
Honored Contributor

Re: can not display problem

Satyach,

It looks the the program that you've compiled is trying to send display but doesn't know where to send it because the DISPLAY environt variable is either not set or set incorrectly. (Probably some X/Gui oriented program). Set the DISPLAY to the IP address of the machine which running an X server.

-Santosh
Life is what's happening while you're busy making other plans
Alex Glennie
Honored Contributor

Re: can not display problem

export DISPLAY=HOST ID:0.0
where HOST ID=ip address or hostname of the system you wish to see the gui on.

If it comes back with not authorised errors try running xhost + or use xhost by itself to check to see if the local Xserver has access. see man xhost for more details
satyach
Advisor

Re: can not display problem

I am adding some more details to the my problem

my display env and xhost defined correctely. i tested by invoking xclock and xterm.

Satya
Alex Glennie
Honored Contributor

Re: can not display problem

Where and on what are you running this on ie is the monitor & graphics H/W capable of running an Xserver and if yes is one running ? If this is just on a console or wyse terminal etc this is your problem !

can you give the exact syntax of the error you are getting presumably when you attempt to run the executable you compiled right ?

Are you su'ing to another user to do this ? and does ps -ef | grep X return a "-auth" ?

can you post also the output from echo $DISPLAY and nslookup HOST ID command.

lastly you program couldn't be automatically setting the DISPLAY variable could it ?
satyach
Advisor

Re: can not display problem

I am adding more details

case 1.

I tested the application on HP11.0 and wehre executable created. That is sitting infront of the same machine.

I am getting the same error.

2. If i am testing on different machine by login to the HP machine, I am getting the same error.

even though if set DISPLAY and xhost properly.

case 3.

While linking If i use +A option, with out shared library. I am getting following error
aCC runtime: ERROR: Unexpected use of shared libraries
aCC runtime: ERROR: Read aCC manpage, +A option
/usr/lib/libnss_files.1
IOT trap (core dumped)

I am preffering to create the executable with static archive libraries. but it gives the above error.