Jump to content

  • Log In with Google      Sign In   
  • Create Account

MSVS's preprocessor vs gcc's preprocessor


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
69 replies to this topic

#21 Bregma   Crossbones+   -  Reputation: 5133

Like
7Likes
Like

Posted 25 March 2014 - 07:45 PM

#include <GL/glut.h>

Make sure your -I switch points to the folder containg the GL folder.  For example, if the glut.h file is in F:\school\csci\opengl\SB5\Src\GLTools\include\gl\glut.h then the command-line argument needs to be -IF:\school\csci\opengl\SB5\Src\GLTools\include .. just in case it was not clear.  It really is important to see exactly what the error message is.

 

Also, I'm not sure what environment you run in, but it's usually possible to capture all diagnostic output into a text file for later analysis.  In the environment in which I work, adding '>build.log 2>&1' works, but if you're using an IDE surely there is some equivalent.


Stephen M. Webb
Professional Free Software Developer

Sponsor:

#22 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 25 March 2014 - 10:33 PM

I tried to find the paths to all the header files I was referencing and I could not find my gl.h or glu.h files anywhere on my computer. 



#23 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 25 March 2014 - 10:37 PM

#include <GL/glut.h>

Make sure your -I switch points to the folder containg the GL folder.  For example, if the glut.h file is in F:\school\csci\opengl\SB5\Src\GLTools\include\gl\glut.h then the command-line argument needs to be -IF:\school\csci\opengl\SB5\Src\GLTools\include .. just in case it was not clear.  It really is important to see exactly what the error message is.

 

Also, I'm not sure what environment you run in, but it's usually possible to capture all diagnostic output into a text file for later analysis.  In the environment in which I work, adding '>build.log 2>&1' works, but if you're using an IDE surely there is some equivalent.

 

 

I am using the command lines, I only use the IDE to look at unformatted text. I use code blocks and gcc compiler for my environment.  I would like to build a text file for my errors I just don't know how to. 



#24 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 25 March 2014 - 10:55 PM

gl.h defines GLAPI, and that's what I am getting errors about. 



#25 georger.araujo   Members   -  Reputation: 817

Like
3Likes
Like

Posted 25 March 2014 - 11:15 PM

gl.h defines GLAPI, and that's what I am getting errors about. 

 

You got that code from here, right?

 

To make a long history short: it's a can of worms. I just wasted a few hours of my life trying to make it work. Couldn't get it right on GCC nor in VS2013.

 

So either try to follow the development environment as much as possible by using VS2010 (which is no guarantee that you won't run into problems), or consider getting the example code of the 6th edition of the book (at your own risk, of course).



#26 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 25 March 2014 - 11:41 PM

Alright so I was able to grab the scroll bar right after I hit enter and it said this; error gl.h included before glew.h error gl.h included before glew.h


Edited by 4mad3u5, 25 March 2014 - 11:41 PM.


#27 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 25 March 2014 - 11:48 PM

 

gl.h defines GLAPI, and that's what I am getting errors about. 

 

You got that code from here, right?

 

To make a long history short: it's a can of worms. I just wasted a few hours of my life trying to make it work. Couldn't get it right on GCC nor in VS2013.

 

So either try to follow the development environment as much as possible by using VS2010 (which is no guarantee that you won't run into problems), or consider getting the example code of the 6th edition of the book (at your own risk, of course).

 

 

no I looked at the source code of gl.h from here 

www.cs.unm.edu/~angel/BOOK/INTERACTIVE_COMPUTER_GRAPHICS/SIXTH_EDITION/CODE/include/GL/gl.h



#28 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 25 March 2014 - 11:50 PM

different book should be the same thing, and I am using that book as well. 



#29 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 25 March 2014 - 11:52 PM

yeap there is all the stuff I am missing 


Edited by 4mad3u5, 25 March 2014 - 11:52 PM.


#30 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 26 March 2014 - 09:09 AM

If anyone can tell me whats going on and how to fix this I would appreciate it. 



#31 BitMaster   Crossbones+   -  Reputation: 4074

Like
0Likes
Like

Posted 26 March 2014 - 09:32 AM

Alright so I was able to grab the scroll bar right after I hit enter and it said this; error gl.h included before glew.h error gl.h included before glew.h


You appear to be including the OpenGL headers before including glew.h in some translation unit. That cannot work, GLEW takes over all responsibility normally held by gl.h. If your own sources or library headers you use include gl.h directly or indirectly you must ensure glew.h is included before they are.

#32 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 26 March 2014 - 10:22 AM

I have not added GLTools.h yet and I added glew.h above gl.h and that error went away and all I got was: "In file included from triangle.cpp:6:0: 

 

and a bunch of this:

API void APIENTRY gluEndSurface (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:239:1: error: 'GLAPI' does not name a type
API void APIENTRY gluEndTrim (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:240:1: error: 'GLAPI' does not name a type
API const GLubyte * APIENTRY gluErrorString (GLenum error);

program files\codeblocks\mingw\include\gl\glu.h:241:1: error: 'GLAPI' does not name a type
API const wchar_t * APIENTRY gluErrorUnicodeStringEXT (GLenum error);

program files\codeblocks\mingw\include\gl\glu.h:242:1: error: 'GLAPI' does not name a type
API void APIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);

program files\codeblocks\mingw\include\gl\glu.h:243:1: error: 'GLAPI' does not name a type
API const GLubyte * APIENTRY gluGetString (GLenum name);

program files\codeblocks\mingw\include\gl\glu.h:244:1: error: 'GLAPI' does not name a type
API void APIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);

program files\codeblocks\mingw\include\gl\glu.h:245:1: error: 'GLAPI' does not name a type
API void APIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);

program files\codeblocks\mingw\include\gl\glu.h:246:1: error: 'GLAPI' does not name a type
API void APIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, G
uble upZ);

program files\codeblocks\mingw\include\gl\glu.h:247:1: error: 'GLAPI' does not name a type
API GLUnurbs* APIENTRY gluNewNurbsRenderer (void);

program files\codeblocks\mingw\include\gl\glu.h:248:1: error: 'GLAPI' does not name a type
API GLUquadric* APIENTRY gluNewQuadric (void);

program files\codeblocks\mingw\include\gl\glu.h:249:1: error: 'GLAPI' does not name a type
API GLUtesselator* APIENTRY gluNewTess (void);

program files\codeblocks\mingw\include\gl\glu.h:250:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNextContour (GLUtesselator* tess, GLenum type);

program files\codeblocks\mingw\include\gl\glu.h:251:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);

program files\codeblocks\mingw\include\gl\glu.h:252:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);

program files\codeblocks\mingw\include\gl\glu.h:253:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);

program files\codeblocks\mingw\include\gl\glu.h:254:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloa
control, GLint sOrder, GLint tOrder, GLenum type);

program files\codeblocks\mingw\include\gl\glu.h:255:1: error: 'GLAPI' does not name a type
API void APIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);

program files\codeblocks\mingw\include\gl\glu.h:256:1: error: 'GLAPI' does not name a type
API void APIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);

program files\codeblocks\mingw\include\gl\glu.h:257:1: error: 'GLAPI' does not name a type
API void APIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);

program files\codeblocks\mingw\include\gl\glu.h:258:1: error: 'GLAPI' does not name a type
API void APIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);

program files\codeblocks\mingw\include\gl\glu.h:259:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, G
uble* winY, GLdouble* winZ);

program files\codeblocks\mingw\include\gl\glu.h:260:1: error: 'GLAPI' does not name a type
API void APIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);

program files\codeblocks\mingw\include\gl\glu.h:261:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);

program files\codeblocks\mingw\include\gl\glu.h:262:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);

program files\codeblocks\mingw\include\gl\glu.h:263:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);

program files\codeblocks\mingw\include\gl\glu.h:264:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);

program files\codeblocks\mingw\include\gl\glu.h:265:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);

program files\codeblocks\mingw\include\gl\glu.h:266:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLv
* dataOut);

program files\codeblocks\mingw\include\gl\glu.h:267:1: error: 'GLAPI' does not name a type
API void APIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);

program files\codeblocks\mingw\include\gl\glu.h:268:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessBeginContour (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:269:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);

program files\codeblocks\mingw\include\gl\glu.h:270:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);

program files\codeblocks\mingw\include\gl\glu.h:271:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessEndContour (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:272:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessEndPolygon (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:273:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);

program files\codeblocks\mingw\include\gl\glu.h:274:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);

program files\codeblocks\mingw\include\gl\glu.h:275:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);

program files\codeblocks\mingw\include\gl\glu.h:276:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX,
double* objY, GLdouble* objZ);

program files\codeblocks\mingw\include\gl\glu.h:277:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view
Ldouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);


school\csci\opengl\SB\SB5\Src\Chapter02\Triangle>g++ -IF:\school\csci\opengl\SB\SB5\Src\lib\include -IF:\school\csci\opengl\SB5\freeglut-2.6.0\include -Llib
lew32 -Lfreeglut man.cpp libglut32.a -lglu32 -lopengl32
file included from man.cpp:6:0:
program files\codeblocks\mingw\include\gl\glu.h:223:24: error: expected ')' before '*' token
pedef void (APIENTRY *_GLUfuncptr)();
                     ^
program files\codeblocks\mingw\include\gl\glu.h:225:1: error: 'GLAPI' does not name a type
API void APIENTRY gluBeginCurve (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:226:1: error: 'GLAPI' does not name a type
API void APIENTRY gluBeginPolygon (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:227:1: error: 'GLAPI' does not name a type
API void APIENTRY gluBeginSurface (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:228:1: error: 'GLAPI' does not name a type
API void APIENTRY gluBeginTrim (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:229:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);

file included from man.cpp:6:0:
program files\codeblocks\mingw\include\gl\glu.h:230:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);

program files\codeblocks\mingw\include\gl\glu.h:231:1: error: 'GLAPI' does not name a type
API void APIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);

program files\codeblocks\mingw\include\gl\glu.h:232:1: error: 'GLAPI' does not name a type
API void APIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:233:1: error: 'GLAPI' does not name a type
API void APIENTRY gluDeleteQuadric (GLUquadric* quad);

program files\codeblocks\mingw\include\gl\glu.h:234:1: error: 'GLAPI' does not name a type
API void APIENTRY gluDeleteTess (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:235:1: error: 'GLAPI' does not name a type
API void APIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);

program files\codeblocks\mingw\include\gl\glu.h:236:1: error: 'GLAPI' does not name a type
API void APIENTRY gluEndCurve (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:237:1: error: 'GLAPI' does not name a type
API void APIENTRY gluEndPolygon (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:238:1: error: 'GLAPI' does not name a type
API void APIENTRY gluEndSurface (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:239:1: error: 'GLAPI' does not name a type
API void APIENTRY gluEndTrim (GLUnurbs* nurb);

program files\codeblocks\mingw\include\gl\glu.h:240:1: error: 'GLAPI' does not name a type
API const GLubyte * APIENTRY gluErrorString (GLenum error);

program files\codeblocks\mingw\include\gl\glu.h:241:1: error: 'GLAPI' does not name a type
API const wchar_t * APIENTRY gluErrorUnicodeStringEXT (GLenum error);

program files\codeblocks\mingw\include\gl\glu.h:242:1: error: 'GLAPI' does not name a type
API void APIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);

program files\codeblocks\mingw\include\gl\glu.h:243:1: error: 'GLAPI' does not name a type
API const GLubyte * APIENTRY gluGetString (GLenum name);

program files\codeblocks\mingw\include\gl\glu.h:244:1: error: 'GLAPI' does not name a type
API void APIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);

program files\codeblocks\mingw\include\gl\glu.h:245:1: error: 'GLAPI' does not name a type
API void APIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);

program files\codeblocks\mingw\include\gl\glu.h:246:1: error: 'GLAPI' does not name a type
API void APIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, G
uble upZ);

program files\codeblocks\mingw\include\gl\glu.h:247:1: error: 'GLAPI' does not name a type
API GLUnurbs* APIENTRY gluNewNurbsRenderer (void);

program files\codeblocks\mingw\include\gl\glu.h:248:1: error: 'GLAPI' does not name a type
API GLUquadric* APIENTRY gluNewQuadric (void);

program files\codeblocks\mingw\include\gl\glu.h:249:1: error: 'GLAPI' does not name a type
API GLUtesselator* APIENTRY gluNewTess (void);

program files\codeblocks\mingw\include\gl\glu.h:250:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNextContour (GLUtesselator* tess, GLenum type);

program files\codeblocks\mingw\include\gl\glu.h:251:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);

program files\codeblocks\mingw\include\gl\glu.h:252:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);

program files\codeblocks\mingw\include\gl\glu.h:253:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);

program files\codeblocks\mingw\include\gl\glu.h:254:1: error: 'GLAPI' does not name a type
API void APIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloa
control, GLint sOrder, GLint tOrder, GLenum type);

program files\codeblocks\mingw\include\gl\glu.h:255:1: error: 'GLAPI' does not name a type
API void APIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);

program files\codeblocks\mingw\include\gl\glu.h:256:1: error: 'GLAPI' does not name a type
API void APIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);

program files\codeblocks\mingw\include\gl\glu.h:257:1: error: 'GLAPI' does not name a type
API void APIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);

program files\codeblocks\mingw\include\gl\glu.h:258:1: error: 'GLAPI' does not name a type
API void APIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);

program files\codeblocks\mingw\include\gl\glu.h:259:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, G
uble* winY, GLdouble* winZ);

program files\codeblocks\mingw\include\gl\glu.h:260:1: error: 'GLAPI' does not name a type
API void APIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);

program files\codeblocks\mingw\include\gl\glu.h:261:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);

program files\codeblocks\mingw\include\gl\glu.h:262:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);

program files\codeblocks\mingw\include\gl\glu.h:263:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);

program files\codeblocks\mingw\include\gl\glu.h:264:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);

program files\codeblocks\mingw\include\gl\glu.h:265:1: error: 'GLAPI' does not name a type
API void APIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);

program files\codeblocks\mingw\include\gl\glu.h:266:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLv
* dataOut);

program files\codeblocks\mingw\include\gl\glu.h:267:1: error: 'GLAPI' does not name a type
API void APIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);

program files\codeblocks\mingw\include\gl\glu.h:268:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessBeginContour (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:269:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);

program files\codeblocks\mingw\include\gl\glu.h:270:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);

program files\codeblocks\mingw\include\gl\glu.h:271:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessEndContour (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:272:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessEndPolygon (GLUtesselator* tess);

program files\codeblocks\mingw\include\gl\glu.h:273:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);

program files\codeblocks\mingw\include\gl\glu.h:274:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);

program files\codeblocks\mingw\include\gl\glu.h:275:1: error: 'GLAPI' does not name a type
API void APIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);

program files\codeblocks\mingw\include\gl\glu.h:276:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX,
double* objY, GLdouble* objZ);

program files\codeblocks\mingw\include\gl\glu.h:277:1: error: 'GLAPI' does not name a type
API GLint APIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view
Ldouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);



#33 BitMaster   Crossbones+   -  Reputation: 4074

Like
2Likes
Like

Posted 26 March 2014 - 10:28 AM

How exactly does triangle.cpp look now?

#34 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 26 March 2014 - 11:14 AM

// Triangle.cpp
// Our first OpenGL program that will just draw a triangle on the screen.

#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h> // Windows FreeGlut equivalent

//#include <GLTools.h> // OpenGL toolkit


///////////////////////////////////////////////////////////////////////////////
// Window has changed size, or has just been created. In either case, we need
// to use the window dimensions to set the viewport and the projection matrix.
void ChangeSize(int w, int h)
{
    glViewport(0, 0, w, h);
}


///////////////////////////////////////////////////////////////////////////////
// Called to draw scene
void RenderScene(void)
{
    // Clear the window with current blue color
    glClearColor(0.0f, 0.0f, 1.0f, 1.0f );
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    // Perform the buffer swap to display back buffer
    glutSwapBuffers();
}


///////////////////////////////////////////////////////////////////////////////
// Main entry point for GLUT based programs
int main(int argc, char* argv[])
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
    glutInitWindowSize(800, 600);
    glutCreateWindow("Triangle");
    glutReshapeFunc(ChangeSize);
    glutDisplayFunc(RenderScene);

    glutMainLoop();

    return 0;
}


#35 Bregma   Crossbones+   -  Reputation: 5133

Like
3Likes
Like

Posted 26 March 2014 - 12:15 PM

I think the header files may be set up to build under MSVC, so the #ifdefs may be set incorrectly. What if you add -DGLAPI to the command line?

Edited by Bregma, 26 March 2014 - 12:19 PM.

Stephen M. Webb
Professional Free Software Developer

#36 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 26 March 2014 - 12:31 PM

I think the header files may be set up to build under MSVC, so the #ifdefs may be set incorrectly. What if you add -DGLAPI to the command line?

 

 

Just at the end of my command line, or where I put my -o to rename my file and -Wall to turn on error checking?


Edited by 4mad3u5, 26 March 2014 - 12:32 PM.


#37 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 26 March 2014 - 12:48 PM

I'm sorry that was dumb of me I though I was on a different post. so no need for this post. 


Edited by 4mad3u5, 26 March 2014 - 12:51 PM.


#38 4mad3u5   Members   -  Reputation: 116

Like
-1Likes
Like

Posted 26 March 2014 - 08:09 PM

Anyone have a solution for this?



#39 Vortez   Crossbones+   -  Reputation: 2698

Like
4Likes
Like

Posted 26 March 2014 - 08:55 PM

Did you at least tryed to read this??? Or look at this??? Can you post more than one sentence per post??? If you want to be serious about programming, you have to learn to solve problem on your own sometime. We can help but we can't hold your hand every time a little problem arise.

 

Also, do you really need that GLTool.h? It might be usefull to follow some example in the book, but im pretty sure most of the code can work without it, or with similar code. Beside, that's not like this is the only ressource to learn from. Most of the time when i see files like that, i just ignore them and try to do without them to be honest. What will you do when you work in the industry? Ask everyone to use GLTool.h because that's what you used at school and can't do without it? Like i said, it's nice to learn from that book but far from indispensable.

 

There's a fully compiled example here for vs 2010, and before you tell me vs is crap like in you other posts, well it's not, and at least you don't have to work with the command line, which is IMO really, really outdated (i dont get why ppl still compile in command line for anything except assembly...) Another thing that annoy me with your book is that it uses it's own OpenGL headers and libraries files, and they're in the same folder as the default one(for visual studio at least) so it complicate the projects setup a bit (ie: you might have to rename the existing folder or files for example to make the code work properly, or move them, or whatever...)


Edited by Vortez, 26 March 2014 - 09:19 PM.


#40 4mad3u5   Members   -  Reputation: 116

Like
0Likes
Like

Posted 26 March 2014 - 09:14 PM

 

 

There's a fully compiled example here for vs 2010, and before you tell me vs is crap like in you other posts, well it's not, and at least you don't have to work with the command line, which is IMO really, really outdated (i dont get why ppl still compile in command line for anything except assembly...)

 

I'm sorry I did not know the opengl community was so sensitive to talking bad about microsoft, I am new and it will not happen again.  






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS