Sign in to follow this  

100s of meaningless errors

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

I am new to OpenGL programming in C++, and am TRYING to get started. However when i try to compile my first program, i get a list of 100s of meaningless syntax errors in GL.h. The problem seems to be caused by simply trying to include gl.h. Does anone have any idea what is going on? I am using Visual C++ .NET 2003, if that helps at all.

Share this post


Link to post
Share on other sites
the first few errors are:

error C2144: syntax error : 'void' should be preceded by ';'
error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
error C2146: syntax error : missing ';' before identifier 'glAccum'
error C2182: 'APIENTRY' : illegal use of type 'void'
error C2144: syntax error : 'void' should be preceded by ';'
error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
error C2086: 'int WINGDIAPI' : redefinition
error C2146: syntax error : missing ';' before identifier 'glAlphaFunc'

the rest is all similar stuff (although since there are hundreds of them, I haven't serached very thoroughly)

keep in mind that these are all coming from gl.h, which was provided with the compiler, so obviously these syntax errors aren't "right"

Share this post


Link to post
Share on other sites
Quote:
Original post by Durfy
Did you include the libraries for OpenGL in your project settings?
-durfy


If that were the problem, the OP would much more likely be seeing linker errors.

Share this post


Link to post
Share on other sites
well, the problem IS actually that i didn't include windows.h before gl.h. I have two cpp files, one I wrote myself and one that i didn't. I was assuming the problem was in MY code, but when I looked at the other one I saw this:

#ifdef _WINDOWS
#include <windows.h>
#endif

#include <gl/gl.h>

i took away the first and third lines, and now it works fine. thanks everyone.

Share this post


Link to post
Share on other sites

What defines _WINDOWS? I know Win32 compilent compiliers automatically
pre define _WIN32, so:


#ifdef _WIN32
# include <windows.h>
#endif

#include <gl/gl.h>

Will work just fine on Win32 compilent compiliers.

Share this post


Link to post
Share on other sites

This topic is 3808 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.

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