• Advertisement
Sign in to follow this  

Got stucked because of problem with gl.h

This topic is 3703 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, i have the following code from the Red Book (http://fly.cc.fer.hr/~unreal/theredbook/chapter01.html): #include <GL/gl.h> #include "aux.h" int main(int argc, char** argv) { auxInitDisplayMode (AUX_SINGLE | AUX_RGBA); auxInitPosition (0, 0, 500, 500); auxInitWindow (argv[0]); glClearColor (0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 1.0, 1.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); glBegin(GL_POLYGON); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); sleep(10); } /* as part of a single connected line strip */ glLineStipple (1, 0x1C47); glBegin (GL_LINE_STRIP); for (i = 0; i < 7; i++) glVertex2f (50.0 + ((GLfloat) i * 50.0), 75.0); glEnd (); /* in 4th row, 6 independent lines, */ /* with dash/dot/dash stipple */ for (i = 0; i < 6; i++) { drawOneLine (50.0 + ((GLfloat) i * 50.0), 50.0, 50.0 + ((GLfloat)(i+1) * 50.0), 50.0); } /* in 5th row, 1 line, with dash/dot/dash stipple */ /* and repeat factor of 5 */ glLineStipple (5, 0x1C47); drawOneLine (50.0, 25.0, 350.0, 25.0); glFlush (); } int main(int argc, char** argv) { auxInitDisplayMode (AUX_SINGLE | AUX_RGBA); auxInitPosition (0, 0, 400, 150); auxInitWindow (argv[0]); myinit (); auxMainLoop(display); } and i get around 26 errors in Borland C++ 5.5. They look like this: Error E2141 C:\Borland\BCC55\Include\GL/gl.h 1153: Declaration syntax error Error E2238 C:\Borland\BCC55\Include\GL/gl.h 1154: Multiple declaration for 'WIN GDIAPI' Please help me, i want to learn OpenGL.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Rastoi
#include <GL/gl.h>
#include "aux.h"


First of all your slash is going the wrong way.

#include <GL\gl.h>

Second I'm pretty sure your second include should be

#include <GL\glaux.h>

Share this post


Link to post
Share on other sites
Quote:
Original post by fpsgamer
Quote:
Original post by Rastoi
#include <GL/gl.h>
#include "aux.h"


First of all your slash is going the wrong way.

#include <GL\gl.h>

Second I'm pretty sure your second include should be

#include <GL\glaux.h>


No no no! The slash is going the right way!!! #include <GL/gl.h> is correct. And for glaux it is probably #include <GL/glaux.h>

The backslash would only work on Windows, so using a forward slash in path names should be prefered as this is supposed to work on all platforms.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement