-
GLUT and macro redefinition errors
Hello, I hope this post is in the right section. I've just been trying to get GLUT working with Pelles C using the example code at http://www.trajectorylabs.com/gettin...engl_glut.html
This is my second attempt at getting GLUT to work after being totally baffled the first time a while back, and not managing to solve the problem by inquiring on the Pelles C forum, which to compound the problem I can't even access at the moment for some reason!
Upon compiling I get just the following two errors:
Building myfirst.obj.
C:\Program Files\PellesC\Include\gl\glut.h(19): error #1050: Macro redefinition of 'APIENTRY'.
C:\Program Files\PellesC\Include\gl\glut.h(20): error #1050: Macro redefinition of 'CALLBACK'.
*** Error code: 1 ***
As far as I can see, I have put all the right files in the right places and ticked the right boxes in the project options (e.g. allow microsoft extensions), and after searching the web for F.A.Q.s I can't find the above errors being addressed. I should stress that although being able to program some C I'm no expert at all this stuff so I could still be doing something stupid I guess.
Any thoughts? Thanks very much.
Andy
-
Super Moderator
OpenGL Lord
Re: GLUT and macro redefinition errors
Macro redefinition of 'APIENTRY'.
: it looks like you have #include of other things before glut. glut.h should (almost) be the only include.
-
Re: GLUT and macro redefinition errors
Hmm, I've just got the following (full code is in the link I posted)
#include <windows.h>
#include <gl\gl.h>
#include <gl\glut.h>
Then it goes on to prototypes.
So there's not much to go wrong with. I've tried selectively taking each one out to see what happens. Unsurprisingly it tells me to "imporve myself" after casuing more than 100 errors! 
This is really frustrating, I haven't even made OpenGL draw a box yet!
Could it be something to do with Windows Vista?
-
Super Moderator
OpenGL Lord
Re: GLUT and macro redefinition errors
Not Vista, it is more your tool chain that needs some tweaking.
compiler/IDE/libs ?
For simple beginner stuff I found dev-c++ is really great, as you can even get sample code projects for OpenGL win win32, with glut, SDL, whatever, directly from the IDE itself.
-
Re: GLUT and macro redefinition errors
Tweaking the compiler and libraries and stuff... oh dear, not one of my strong points! I'm playing round with various project options at the moment but frankly I don't really know what I'm doing.
-
Re: GLUT and macro redefinition errors
Here's a thought: if I uninstall PellesC and then reinstall, then redownload the appropriate GLUT files - can there be anything that I'd have to change... surely it should work....
-
Super Moderator
OpenGL Lord
Re: GLUT and macro redefinition errors
then don't waste time :
http://www.bloodshed.net/dev/devcpp.html
Within Dev-C++, in menu Tools, Check for updates/packages, then community packs or something. I recommend the freeglut examples (modern opensource GLUT).
Then File, new project, multimedia tab, freeglut. F9. It works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules