missing identfiers?

This is a discussion on missing identfiers? within the C++ Programming forums, part of the General Programming Boards category; I have a few errors when compiling this code regarding the Polygon class Code: #include <ctime> #include <iostream.h> #include <GL/glut.h> ...

  1. #1
    *hiding*
    Guest

    missing identfiers?

    I have a few errors when compiling this code regarding the Polygon class

    Code:
    #include <ctime>
    #include <iostream.h>
    #include <GL/glut.h>
    #include "ball.h"
    #include "paddle.h"
    #include "polygon.h"
    .
    .
    .
    .
    //function containing errors
    void renderScene( )
    {
    	glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    	glColor3f( 1.0f, 0.0f, 0.0f );
    
    	glLoadIdentity( );
    
    	Vector3d temp[ 3 ];
    	temp[ 0 ].setValues( 0, 1, 0 );
    	temp[ 1 ].setValues( -1, -1, 0 );
    	temp[ 3 ].setValues( 1, -1, 0 );
    
    	Polygon p( temp, 3 );
    
    	ball.drawBall( );
    	paddle.drawPaddle( );
    
    	glutSwapBuffers( );
    	CalculateFrameRate( );
    
    }
    The errors all suggest that I haven't included polygon.h at the top but as you can see this is not the case. Any suggestion??

  2. #2
    Unregistered
    Guest
    oh yeah the errors, sorry:

    error C2146: syntax error : missing ';' before identifier 'p'
    warning C4551: function call missing argument list
    error C2065: 'p' : undeclared identifier

  3. #3
    Unregistered
    Guest
    what still no answer???

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    What polygon.h look like?

  5. #5
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412

    void renderScene( )
    {
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    glColor3f( 1.0f, 0.0f, 0.0f );

    glLoadIdentity( );

    Vector3d temp[ 3 ];
    temp[ 0 ].setValues( 0, 1, 0 );
    temp[ 1 ].setValues( -1, -1, 0 );
    temp[ 3 ].setValues( 1, -1, 0 );

    Polygon p( temp, 3 );

    ball.drawBall( );
    paddle.drawPaddle( );

    glutSwapBuffers( );
    CalculateFrameRate( );

    }
    This is not a proper class definition????

    void class-scope resolution operator-function(){}




    ball.drawBall( );
    paddle.drawPaddle( );

    ball and paddle are not defined locally. are they global? And it actually appears you are using the classname as the object reference and not an object instantiation.

    ball myball;
    paddle mypaddle;

    myball.drawBall();
    mypaddle.drawPaddle();
    Last edited by Betazep; 04-15-2002 at 07:33 PM.
    Blue

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 02:29 PM
  2. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  3. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 09:26 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 11:52 PM
  5. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21