Jump to content
  • Advertisement
Sign in to follow this  
Codorke

OpenGL Quadratics

This topic is 4876 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

Hi, I'm having problems with quaqratics. My compiler gives me always this error : error C2061: syntax error : identifier 'gluNewQuadric' my code : #pragma once #include <windows.h> // Header File For Windows #include <gl\gl.h> // Header File For The OpenGL32 Library #include <gl\glu.h> // Header File For The GLu32 Library #include <gl\glaux.h> // Header File For The GLaux Library GLUquadricObj *Quadratic = new gluNewQuadric(); GLUquadricNormals(Quadric, GLU_SMOOTH); I'm using Microsoft Visual C++ .NET (just information) Does anyone reconise this error, or know how to fix it ? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Quote:
GLUquadricObj *Quadratic = new gluNewQuadric();


You need to remove the 'new' in this line. gluNewQuadric is a function.

Share this post


Link to post
Share on other sites
Quote:
GLUquadricObj *Quadratic = new gluNewQuadric();
GLUquadricNormals(Quadric, GLU_SMOOTH);


gluNewQuadric() returns a pointer to a quadric object, so don't use the new operator. And they are also called "quadrics" and not "quadratics," so to be consistent that first line should be (especially since you use Quadric in the second line)...
GLUquadricObj *Quadric = gluNewQuadric();


Also the second line should be...
gluQuadricNormals(Quadric, GLU_SMOOTH);
with lower-case "glu" and upper-case "Q"

EDIT: Typo

Share this post


Link to post
Share on other sites
Thanks for the replies but i still have some errors.

Now the pronlem is solved about the new operator but not with the gluQuadraticNormals :
error C2501: 'gluQuadricNormals' : missing storage-class or type specifiers
error C2365: 'gluQuadricNormals' : redefinition; previous definition was a
'function'
error C2078: too many initializers



GLUquadricObj *Quadric = gluNewQuadric();
gluQuadricNormals(Quadric, GLU_SMOOTH);

What's wrong this time ?


Share this post


Link to post
Share on other sites
gluQuadricNormals needs to be called inside of a function. Calling it outside of one as you do now makes the compiler thinks it's a function declaration

Share this post


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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!