PDA

View Full Version : Simple square issue



Lvl80retpaladin
01-24-2010, 09:16 PM
This is my second OpenGL program I've tried compiling, so keep in mind I have no clue what I'm doing. It's a lesson in the OpenGl superbible about how to draw a simple square. For the following code, I'm getting an error for each gl0rtho function call, which says that there are "too many initializers found". However if I take off the type (float) I get "initializer not found". How can there be too many initializers, but then when there is none I need one? Can you guys help me with this? I'm completely new to OpenGL. Note that originally there was no type (float) definition; I added that in when I got the error message for having no initializers.



void ChangeSize(GLsizei w, GLsizei h)
{
if ( w <= h)
float gl0rtho (-100.0, 100.0, -100 / aspectRatio, 100.0 / aspectRatio, 1.0, -1.0);
else
float gl0rtho (-100.0 * aspectRatio, 100.0 * aspectRatio, -100.0, 100.0, 1.0, -1.0);
}

Lvl80retpaladin
01-24-2010, 10:30 PM
My apologies, the problem in that was that glOrtho was an uppercase o; I thought it was a zero. Now that that has been fixed there is a new problem, though. I take away the identifier and change it correctly to glOrtho, then 16 errors come up stating 16 different GL and glut functions have "unresolved external symbols". One such function is
glLoadIdentity();

What does it mean to have an unresolved external symbol?

cjopengler
01-25-2010, 02:24 AM
What's your OS? If you use VC in windows, it's for you don't add glut32.lib and opengl32.lib into your project. You can right click your VC project and select "properties" and then add glut32.lib and opengl32.lib. Don't forget that put your glut32.dll into windows/system32 folder to make VC load the dll automatically.

Lvl80retpaladin
01-25-2010, 02:02 PM
You're correct, I have VC++. Can you give more specific instructions on how to add glut32.lib and opengl32.lib into my project? I right click Solution "openGL" - > properties then am unsure of how to advance to add those files. I have those files on my computer.

Thanks

- Sean

Lvl80retpaladin
01-26-2010, 02:36 PM
Bumped.

Lvl80retpaladin
01-27-2010, 05:35 PM
Bumped.