Discussion:
gv: Unable to open the display
Alex Vinokur
21 years ago
Permalink
$ gv -v
gv: Unable to open the display

$ cygcheck -sr | grep ghost
ghostscript-base 7.05-2
ghostscript-x11 7.05-2

Also:
$ which -a gs
/usr/local/bin/gs
/usr/bin/gs
/bin/gs
/usr/bin/gs
/usr/X11R6/bin/gs

$ gs -v
GNU Ghostscript 8.01 (2004-01-30)
Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.

$ /usr/X11R6/bin/gs -v
GNU Ghostscript 7.05 (2002-04-22)
Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.



Why is 'gv' unable to open the display?
--
Alex Vinokur
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
Alex Vinokur
21 years ago
Permalink
Post by Alex Vinokur
$ gv -v
gv: Unable to open the display
$ cygcheck -sr | grep ghost
ghostscript-base 7.05-2
ghostscript-x11 7.05-2
$ which -a gs
/usr/local/bin/gs
/usr/bin/gs
/bin/gs
/usr/bin/gs
/usr/X11R6/bin/gs
$ gs -v
GNU Ghostscript 8.01 (2004-01-30)
Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.
$ /usr/X11R6/bin/gs -v
GNU Ghostscript 7.05 (2002-04-22)
Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
Why is 'gv' unable to open the display?
[snip]

Also:

$ /usr/X11R6/bin/gs foo.tex
GNU Ghostscript 7.05 (2002-04-22)
Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GNU Ghostscript 7.05: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting.
--
Alex Vinokur
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
Benjamin Riefenstahl
21 years ago
Permalink
Hi Alex,
Post by Alex Vinokur
$ /usr/X11R6/bin/gs foo.tex
GNU Ghostscript 7.05 (2002-04-22)
Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GNU Ghostscript 7.05: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting.
Start your application from a running xterm, or use the -display
option of gs and gv, or set the DISPLAY environment variable. See
man X for details.

benny
Dr. Volker Zell
21 years ago
Permalink
Post by Alex Vinokur
$ gv -v
gv: Unable to open the display
$ cygcheck -sr | grep ghost
ghostscript-base 7.05-2
ghostscript-x11 7.05-2
$ which -a gs
/usr/local/bin/gs
/usr/bin/gs
/bin/gs
/usr/bin/gs
/usr/X11R6/bin/gs
Make sure /usr/X11R6/bin/gs is first in your path.

Ciao
Volker
Igor Pechtchanski
21 years ago
Permalink
Post by Dr. Volker Zell
Post by Alex Vinokur
$ gv -v
gv: Unable to open the display
That's because the DISPLAY variable is not set correctly. For a default X
invocation (no display number on the command line), DISPLAY should be
":0.0".
Post by Dr. Volker Zell
Post by Alex Vinokur
$ cygcheck -sr | grep ghost
ghostscript-base 7.05-2
ghostscript-x11 7.05-2
$ which -a gs
/usr/local/bin/gs
/usr/bin/gs
/bin/gs
/usr/bin/gs
/usr/X11R6/bin/gs
Make sure /usr/X11R6/bin/gs is first in your path.
Good advice in any case.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ***@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing." -- Dr. Jubal Harshaw
Alex Vinokur
21 years ago
Permalink
...
[snip]


Some changes have be done.

$ which gs
/usr/X11R6/bin/gs


$ set | grep DISP
DISPLAY=:0.0

$ gs zzz.tex
GNU Ghostscript 7.05 (2002-04-22)
Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GNU Ghostscript 7.05: Cannot open X display `:0.0'.
**** Unable to open the initial device, quitting.


Something else?

Thanks.
--
Alex Vinokur
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
Igor Pechtchanski
21 years ago
Permalink
...
Yeah. Run X? ;-)
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ***@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing." -- Dr. Jubal Harshaw
Alex Vinokur
21 years ago
Permalink
...
Indeed. Thanks.

--- xterm ---
$ gv foo.ps // works fine.
$ gs foo.ps // works fine.

However
$ gs foo.tex
GNU Ghostscript 7.05 (2002-04-22)
Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in \documentstyle
Operand stack:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2
%stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3
%oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2
%stopped_push --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1081/1123(ro)(G)-- --dict:0/20(G)-- --dict:69/200(L)--
Current allocation mode is local
Current file position is 123
GNU Ghostscript 7.05: Unrecoverable error, exit code 1

--------------------------------
--
Alex Vinokur
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
Igor Pechtchanski
21 years ago
Permalink
...
Now, why would ever you do something silly like this?

.tex files aren't .ps files, so *obviously* gs won't understand them.
It's like expecting gs to understand the following C program:

#include <stdio.h>
int main(int ac, char *av[]) {
printf("%s",
"%!PS-Adobe-2.0\n"
"%%Pages: 1\n"
"%%PageOrder: Ascend\n"
"%%BoundingBox: 0 0 596 842\n"
"%%EndComments\n"
"%%Page: 1 1\n"
"showpage\n"
"%%EOF\n");
}

(which, BTW, will produce one possible empty PostScript file).

A .tex file is essentially a *program* (well, a set of Turing-complete
markup macros) that you need to run through a compiler to get a document
out. The "tex" executable is such a compiler (or the "latex" executable
if you use the LaTeX set of macros). Either of those will produce a .dvi
file, which you need to convert to .ps with the help of the "dvips"
executable. Only when this conversion is done can you view the resulting
.ps file.

All of the above, BTW, is right there in black and white in the TeX FAQ:
<http://www.tex.ac.uk/cgi-bin/texfaq2html?label=readtex>. Furthermore,
the Cygwin/X list is definitely the wrong place to discuss this (and so is
the main Cygwin list, as this is in no way whatsoever related to Cygwin).
The correct, if terse, response to the error above would be "this is
expected behavior, period".

If you have further questions about TeX/LaTeX, please see
<http://www.tex.ac.uk/cgi-bin/texfaq2html?label=maillists>. If you have
specific problems with the Cygwin version of TeX/LaTeX (i.e., problems
that you can't reproduce on a Linux system, or using a MiKTeX
distribution), please feel free to ask on the main Cygwin list.
HTH,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ***@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing." -- Dr. Jubal Harshaw
Igor Pechtchanski
21 years ago
Permalink
Post by Igor Pechtchanski
Post by Alex Vinokur
However
$ gs foo.tex
[legitimate Ghostscript error snipped]
GNU Ghostscript 7.05: Unrecoverable error, exit code 1
Now, why would ever you do something silly like this?
!sed -e 's/\(ever\) \(you\)/\2 \1/'

#include <stdio.h>
int main(int ac, char *av[]){
for(int i=0;i<500;i++){
printf("I will re-read my messages before hitting SEND\n");}}

Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ***@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing." -- Dr. Jubal Harshaw
Igor Furlan
21 years ago
Permalink
Post by Igor Pechtchanski
#include <stdio.h>
int main(int ac, char *av[]){
for(int i=0;i<500;i++){
printf("I will re-read my messages before hitting
SEND\n");}}
Igor
http://sourceforge.net/people/viewprofile.php?user_id=189422
Igor Pechtchanski
21 years ago
Permalink
<http://cygwin.com/acronyms/#PCYMTNQREAIYR>, now with more reasons.
Post by Igor Furlan
Post by Igor Pechtchanski
#include <stdio.h>
int main(int ac, char *av[]){
for(int i=0;i<500;i++){
printf("I will re-read my messages before hitting
SEND\n");}}
Igor
http://sourceforge.net/people/viewprofile.php?user_id=189422
And your point was?
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ***@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing." -- Dr. Jubal Harshaw
Loading...