This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

opengl, glut, and many syntax errors


I'm trying to compile a c++ program that uses the header files
    glut.h
    glu.h
    gl.h
I am using the gcc compiler that came with the gnuwin32 cdk package.
When I try to compile a program using the following command at the dos prompt
    gcc (filename) -lstdc++ -lglut32 -lopengl32 -lglu32
I get a lot of syntax errors such as the following...

In file included from 
C:\\gnuwin32\\b18\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32\\cygnus-2.7.2-9
70404\\../../../../i386-cygwin32/include/gl\\glut.h:14,
                 from pc5d.cc:59:
C:\\gnuwin32\\b18\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32\\cygnus-2.7.2-9
70404\\../../../../i386-cygwin32/include/GL/gl.h:1135: syntax error before 
`void'
C:\\gnuwin32\\b18\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32\\cygnus-2.7.2-9
70404\\../../../../i386-cygwin32/include/GL/gl.h:1473: syntax error before `*'

,etc.

These syntax errors occur in lines in gl.h and glu.h that has the word
"APIENTRY" in them.  For example....
     WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
(from line 1135 in gl.h)

I think that the problem may be in the following lines of code in the glut.h 
header.

#ifndef __glut_h__
#define __glut_h__

#if defined(WIN32)
#include <windows.h>
#pragma warning (disable:4244)	/* disable bogus conversion warnings */
#endif
#include <GL/gl.h>
#include <GL/glu.h>

/* define APIENTRY and CALLBACK to null string if we aren't on Win32 */
#if !defined(WIN32)
#define APIENTRY
#define CALLBACK
#endif


I suspect that the compiler is evaluating the line "#if defined(WIN32)" as 
being false, but I don't know how to confirm this, and I wouldn't know what to 
do about it if this were the case.  Can anyone tell me if I'm on the right 
track, or if it is even possible to get compile opengl programs (with glut 
utilities--glut.h) with this version of the gcc compiler.


Any help would be appreciated,
Lee Morgan
lmorgan1@ua1vm.ua.edu

P.S. I'm sure that the libraries and header files are in the correct 
directories.

P.P.S.  I read the mail in the Dec 1997 archives regarding 
Re: g++, opengl, and STDCALL, * __attribute__ ((stdcall)) problem. Colin Peters 
Re: g++, opengl, and STDCALL, * __attribute__ ((stdcall)) problem. Ulisses T. 
Mello 
These suggestions did not get rid of my syntax errors.  In some cases it just 
moved the error to another point in the line.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]