So, this is major thread necroing, but after running into this header problem on several compilers in the past, forgetting the solution, then having to do a quick run through to remember the fix, I'm posting a quick fix to this. For future reference to the future me in ten years when it comes up again, if nothing else.
Just toss in the two headers:
#include <windows.h>
#include <gl/gl.h>
and the problem is fixed, unless you want to mess with the glut header itself. This works for the freeglut code here as well.
I hope this helps any newbies doing a search on the error, since this comes up as the first hit on google.
redeclaration of C++ built-in type
I faced "error redeclaration of c++ built-in type 'wchar_t'" at the time of my car racing project. I tried a lot and searched in google,but didn't found any solution to solve my problem :-(
But later,i solved this by including "windows.h" by myself :-)
#include<windows.h>
#include<bits/stdc++.h>
#include<GL/glut.h>
#include<windows.h> --->have to be added in the top,if its added under the glut.h. then there will be error.
#include<bits/stdc++.h> ---> just added for safety :-p
use #include<GL/glut.h> or #include<glut.h> -----> depends on the folder where the glut.h has been placed.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement