• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
4mad3u5

MSVS's preprocessor vs gcc's preprocessor

69 posts in this topic

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
0

Share this post


Link to post
Share on other sites

 

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

0

Share this post


Link to post
Share on other sites

yeap there is all the stuff I am missing 

Edited by 4mad3u5
0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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.
0

Share this post


Link to post
Share on other sites

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);

0

Share this post


Link to post
Share on other sites
// 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;
}
0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

 

 

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.  

0

Share this post


Link to post
Share on other sites

 

 

 

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.  

 

 

To be fair this is more my own personal rant than the general opinion ( a lot of ppl here use gcc and i just don't get why tbh...)

0

Share this post


Link to post
Share on other sites

 

 

 

 

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.  

 

 

"I hate Microsoft because EVIL EVIL EVIL" you'd better be prepared to back it up, otherwise people are going to assume that you're just trolling or trying to start a flame war (and any valid point you may be trying to make will get lost as a result - which I'm sure is a result you don't want).

 

 

This was never said, I don't care it wasn't, I might have nonchalantly said they want your money; however, for a beginner who every single book he reads says microsoft is trying to kill opengl, wondering why I should use msvs is a pretty good question.  And even to this day my instructor because I haven't brought a counter point to him, believes that because msvs express 2008 has a date on it that they might discontinue it and we won't know how to use another platform and we would all have to pay microsoft. This isn't just some flamebait statement even though it might have came out that way, this is stuff I talk to instructors about all the time.

Edited by 4mad3u5
-1

Share this post


Link to post
Share on other sites

You are currently sitting in several distinct holes:

(1) you appear to be learning your first programming language

(2) you are learning C++

(3) you are trying to use the non-default compiler for your platform

(4) you are trying to work with an API you don't know yet

(5) you are trying to work with a library of a 3rd party

 

Now, ideally you want to limit the number of holes you are in at the same time. Especially hole (1) does not really interface well with other holes. Personally I think combining holes (1) and (2) is not a good idea, but apart from a friendly warning (consider it given) I will not stand in anyone's way.

 

I won't go into extensive discussions about the merits and future of free Express Editions of MSVC. To be honest, I don't really care and at this point neither should you. What you produce at this point is not worth keeping. I don't say this because I believe you are stupid or because I try to be unkind. I say that because learning C++ takes time. If Microsoft shuts down MSVC Express a year from now and none of your code works on other compilers you have not really lost anything.

You did gain a little bit of proficiency in the language though. Enough to try your hands at hole (3) for example. That's an interesting hole. It's annoying at first but with sufficient understanding of how your tools are supposed to work and a bit of googling it's solvable.

 

I would strongly advise that every decent programmer tries their hand at hole (3) - once it is in their skills. But that is something you have to solve/research yourself. If you have to run onto a forum without any idea what's happening, it's too early.

 

1) Well I am not learning my first language, I am just learning opengl and have never use libraries in this way before, which opengl makes you do. Working with a language is completely different than working with libraries, I am trying to tap into header files that have dependencies, I have never seen this in a language but I am sure it happens.  And I have never seen a language that doesn't have header files that work because they are from a third party. Which is a hug difference between that and say C, C++, Assembly, LISP, Java, visual basic.net, or any other type of programming I have done. I would have to say since you are not making the distinction between working with a language and working with libraries I don't think you are understanding the situation, which leads to you irrational conclusion of me learning my first language.  

Edited by 4mad3u5
0

Share this post


Link to post
Share on other sites

The whole "Microsoft is trying to kill OpenGL" thing is a classic example of the FUD and misinformation I referred to.  The OpenGL vs D3D war is something that everybody is incredibly tired of; it's really not worth going over in detail, but the brief summary is:

  • Microsoft wanted OpenGL for NT workstations in order to be able to compete with Unix workstations.
  • The OpenGL group at Microsoft refused to play ball with the games people, so the games people needed a new 3D API.
  • Hence Direct3D was born.
  • Microsoft's flagship OS at the time - Windows NT4 - didn't even support Direct3D, but it did support OpenGL.
  • Direct3D "won the API war" by virtue of offering better tools, better support, more robust drivers and more consistent behaviour across a wider range of hardware.
  • The OpenGL ARB did more damage to OpenGL by messing up two consecutive major versions at critical time periods (the switch from fixed to programmable, and the Vista debacle).

Microsoft is not currently "trying to kill OpenGL" because that battle is long over.  If your instructors are claiming otherwise, then they're working from information that was last current back in 1998 or so, and I'd strongly advise them to update their knowledge.  A common failing of academics (or anyone that's not hands-on with a technology on a day-to-day basis in the real world) is that the real world moves on but their own knowledge and experience doesn't.

 

A great source of information on the whole sorry mess is Alex St John's blog; in case you don't know, Alex was a principal designer and lead on the early versions of DirectX, so in other words he was there at the time and has first-hand knowledge of exactly what was happening inside Microsoft while it was happening.  He was also fired from Microsoft in the late 90s, so is in a position where he can now say what he likes without any paymaster pulling his strings.

 

Posts containing "OpenGL"

"The DirectX Files"

 

Regarding Microsoft themselves, for the past 10 or so years what they've actually been trying to kill has not been OpenGL; they've actually been trying to kill Direct3D instead.  They've been trying to kill it by artificially tying it to unpopular Windows versions, by degrading the quality of their documentation and tools, by introducing breaking changes in other unrelated Windows components, by messing up their PC gaming strategy, by generally behaving as if they haven't a clue what they're doing.

 

So hence the fact that any claim that "Microsoft is trying to kill OpenGL" is in reality quite ridiculous, and it would be really good (not to mention of more benefit to you) if you'd stop such claims.

Edited by mhagain
0

Share this post


Link to post
Share on other sites

 

 

So hence the fact that any claim that "Microsoft is trying to kill OpenGL" is in reality quite ridiculous, and it would be really good (not to mention of more benefit to you) if you'd stop such claims.

 

Man can you not read, I said "however, for a beginner who every single book he reads says microsoft is trying to kill opengl, wondering why I should use msvs is a pretty good question". This is a statement saying where I am coming from. I am not saying this: "So hence the fact that any claim that "Microsoft is trying to kill OpenGL" is in reality quite ridiculous, and it would be really good (not to mention of more benefit to you) if you'd stop such claims.". I look at details just as much as you guys and I am getting a little pissed off you can't read. 

Edited by 4mad3u5
-3

Share this post


Link to post
Share on other sites

You are currently sitting in several distinct holes:

 

(2) you are learning C++

 

 

 

 

 

Wait have I even asked about the C++ language, no not ever. Have I been asking about opengl header files and libraries, umm yes the entire time. 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0