4

The code compiles fine but gives this error on run: freeglut (filename): failed to open display ''

How do I set the display and get it to run? Also trying to open xterm gives the same error (tried this as advice found said to run in an xterm).

genpfault
  • 51,148
  • 11
  • 85
  • 139
Mafro34
  • 510
  • 8
  • 20
  • 1
    Firstly to open an xterm one needs to do the following: 1. set the DISPLAY var using: `export DISPLAY =:0.0` 2. run `startxwin.exe`, this is located in `C:\cygwin\bin` (for default install). You will now be able to run an xterm from a terminal. Note: startxwin.exe must remain running. 3. In Netbeans, go to: project properties > Run > Environment > set DISPLAY to :0.0 Run will now be successful. – Mafro34 Apr 03 '13 at 22:00

1 Answers1

2

You need a running X server, so that X11 based programs can display output. However if your goal is OpenGL development on Windows then you should not use a X server, because, unfortunately, none of the existing X servers for Windows does support modern OpenGL features in their implementation of GLX client and server components.

I strongly suggest you target native Windows GDI when compiling for windows.

datenwolf
  • 159,371
  • 13
  • 185
  • 298