i have written a small c++ code to generate a postscript file. i have installed ghostscript viewer. i am trying to open .ps file in cygwin but got this below error.
$ gs.exe fill_rect_chd.ps
GPL Ghostscript 9.15 (2014-09-22)
Copyright (C) 2014 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 9.15: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting.
GPL Ghostscript 9.15: Cannot open X display `(null)'.
Unrecoverable error: ioerror in setpagedevice
Operand stack:
true --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval--
I am new to postscript. this is the code present in the .ps file
$ cat fill_rect_chd.ps
1 0 0 setrgbcolor
0 0 moveto
100 0 lineto
100 100 lineto
0 100 lineto
fill
Can anyone please suggest/Help me out with this error.
As commented, you need to (install and) run the x.org X-server program (that comes with Cygwin: select the X11:xinit
package) in order to open the graphical window. Or you can install the Windows version of ghostscript.