Skip to main content
gamedev.net
🔒 Locked

Display error using GLUT

Started by cnjcombo Sep 27, 2005 at 11:39 PM 9 replies 2.8k views
Original Post
cnjcombo
cnjcombo
I am currently writing a program in C with OpenGL thrown in for graphical purposes. The current setup is editing source code on my desktop, uploading it, compiling on server, then executing it on the server. In my class I can execute my projects through the command line and they come up and display no problems, when I try to do it on any other(Windows) machine, I get this error: bash-2.05$ ./a.out [Execution command] GLUT: Fatal Error in a.out: could not open display: I have OpenGL installed and all the necessary dll's are in place, any idea as to why it cannot open the display? Can post source code if need be but this seems like a beginner problem and I am just forgetting something.
Drew_Benton
Drew_Benton
Quote:
Original post by cnjcombo
when I try to do it on any other(Windows) machine,
...
bash-2.05$ ./a.out [Execution command]
GLUT: Fatal Error in a.out: could not open display:


Ok if you are working on Windows, and you have that command, it's not existant on the Windows Platform. You will need to change your make file or project settings so it does not use that linux command line. I'm not sure what that line is supposed to do, so can't offer any more than you just need to use a Windows compatible line.
cnjcombo
cnjcombo
a.out is the file produced from compiling a C file on the Linux server, does it need to be compiled on a Windows machine in order to be executable?
Drew_Benton
Drew_Benton
Quote:
Original post by cnjcombo
a.out is the file produced from compiling a C file on the Linux server, does it need to be compiled on a Windows machine in order to be executable?


No, usually when you compile on Windows, it will go like: Your source files (.C) are compiled into object files (.OBJ) and perhaps other intermediate files. Finally the linker takes those OBJ files and any intermediate files and makes an .EXE. You do not need that .out file for Windows. What compiler are you using for this, GCC?
cnjcombo
cnjcombo
I have been pretty much running each program on Linux machines and this is the first time I have tried to write/compile anything on my home machine. I am trying to compile code using Visual Studio, I have all the neccessary headers in the Include folder and Libraries in the GL folder. On windows I am getting over 100 errors linked to the gl.h file. Any ideas? I will update the gl.h file and see if that does anything.
cnjcombo
cnjcombo
Tried updating gl.h didn't work, here are the errors I am receiving....

Compiling...
arrow.c
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1135) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1135) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1135) : error C2146: syntax error : missing ',' before identifier 'glAccum'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1135) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1135) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1136) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1136) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1136) : error C2146: syntax error : missing ',' before identifier 'glAlphaFunc'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1136) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1136) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1137) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1137) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1137) : error C2146: syntax error : missing ',' before identifier 'glAreTexturesResident'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1137) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1137) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1138) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1138) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1138) : error C2146: syntax error : missing ',' before identifier 'glArrayElement'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1138) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1138) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1139) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1139) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1139) : error C2146: syntax error : missing ',' before identifier 'glBegin'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1139) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1139) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1140) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1140) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1140) : error C2146: syntax error : missing ',' before identifier 'glBindTexture'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1140) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1140) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1141) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1141) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1141) : error C2146: syntax error : missing ',' before identifier 'glBitmap'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1141) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1141) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1142) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1142) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1142) : error C2146: syntax error : missing ',' before identifier 'glBlendFunc'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1142) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1142) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1143) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1143) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1143) : error C2146: syntax error : missing ',' before identifier 'glCallList'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1143) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1143) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1144) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1144) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1144) : error C2146: syntax error : missing ',' before identifier 'glCallLists'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1144) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1144) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1145) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1145) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1145) : error C2146: syntax error : missing ',' before identifier 'glClear'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1145) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1145) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1146) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1146) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1146) : error C2146: syntax error : missing ',' before identifier 'glClearAccum'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1146) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1146) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1147) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1147) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1147) : error C2146: syntax error : missing ',' before identifier 'glClearColor'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1147) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1147) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1148) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1148) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1148) : error C2146: syntax error : missing ',' before identifier 'glClearDepth'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1148) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1148) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1149) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1149) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1149) : error C2146: syntax error : missing ',' before identifier 'glClearIndex'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1149) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1149) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1150) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1150) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1150) : error C2146: syntax error : missing ',' before identifier 'glClearStencil'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1150) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1150) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1151) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1151) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1151) : error C2146: syntax error : missing ',' before identifier 'glClipPlane'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1151) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1151) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2146: syntax error : missing ',' before identifier 'glColor3b'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2146: syntax error : missing ',' before identifier 'glColor3bv'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1154) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1154) : error C2085: 'APIENTRY' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1154) : error C2146: syntax error : missing ',' before identifier 'glColor3d'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1154) : error C2143: syntax error : missing ';' before '('
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1154) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1155) : error C2054: expected '(' to follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1155) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.

arrow.obj - 102 error(s), 0 warning(s)
Drew_Benton
Drew_Benton
Oh that just means you need to include before the OpenGL header files. Really though, all you should have to include is GLUT.H and be set, are you?
Peregrin
Peregrin
Add this before any other include:
#include <windows.h>


EDIT: Beaten by Drew. :)
Jooleem. Get addicted.
cnjcombo
cnjcombo
Thanks, everything compiled. Unfortunately now it is seeing that it is missing a library, glut32.lib that I thought I downloaded but apparently didn't. I have been looking online for hte past 10 mins for it and I cannot find it, any ideas on where I can download glut32.lib?
cnjcombo
cnjcombo
Beautiful. Coding on all cylinders now. Thanks for taking the time out tonite to help me out, I was pretty confused and you guys took the time out to help a newb to the language. Speaks volumes for this forum.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.