Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL OpenGL & Dev-C++ Problem

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

Hello all, I''m having some trouble with the default OpenGL project that Dev-C++ creates for you. It worked properly at first, but then I added a TGA loading routine and a class which I have only designed not implemented yet, and I get the following error: 156 C:\dev\exp_conq\main.cpp ISO C++ forbids declaration of `glClearColor'' with no type Then immediately after that: 156 C:\dev\exp_conq\main.cpp `int glClearColor'' redeclared as different kind of symbol and again: 156 C:\dev\exp_conq\main.cpp initializer list being treated as compound expression 156 C:\dev\exp_conq\main.cpp [Warning] initialization to `int'' from `float'' 156 C:\dev\exp_conq\main.cpp [Warning] argument to `int'' from `float'' The code on line 156 is: glClearColor(0.0f, 0.0f, 0.0f, 0.0f); I can see nothing wrong with the code, especially considering that it worked properly before. ??? I''m hoping that this is just a setting that will fix the problem easily. ^_^ I also have the following headers included: #include <windows.h> #include <stdio.h> #include <gl/gl.h> #include <gl/glu.h> Any ideas? P.S. I''m using Dev-C++

Share this post

Link to post
Share on other sites
I just thought this other info might be relevant:

The linker is given the argument -lopengl32

And here is the drawing code:

/* OpenGL animation code goes here */

glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

glBindTexture(GL_TEXTURE_2D, texture[0]);

glPushMatrix ();
glRotatef (theta, 0.0f, 0.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex2f (0.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex2f (1.0f, 0.0f);
glTexCoord2f(1.0f, 1.0f); glVertex2f (1.0f, 1.0f);
glEnd ();
glPopMatrix ();

SwapBuffers (targetDC);

theta += 1.0f;
Sleep (1);

Share this post

Link to post
Share on other sites
GCC can be pissed off if you have a C project which you declare as C++, or the other way around.
Or if you mix C with C++ without doing it properly.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!