Thread: Trouble W/OpenGL C++ Stuff

  1. #1
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Question Trouble W/OpenGL C++ Stuff

    I get errors like the following:

    Code:
    E:\Programs\Projects\OpenGL Tests\Graphic OpenGL Stardate\sdopengl\mainsource.cpp(11) : error C2143: syntax error : missing ';' before '.'
    E:\Programs\Projects\OpenGL Tests\Graphic OpenGL Stardate\sdopengl\mainsource.cpp(11) : error C2501: 'inface' : missing storage-class or type specifiers
    Here's the code. If anybody finds something, can you post answers because I can't find out why.

  2. #2
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Angry ...

    3 Downloads=No Responces?
    Why? Oh and enjoy my new signature... I got bored on the IRC w/da cprogramming.com people.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    20
    Well, its OpenGL code. It probably takes long to read.

    I'm going to download it now.

  4. #4
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    well, my problem isn't in the opengl I think... most of it is directly copied from nehe. I'm learning fonts.

  5. #5
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    Well one thing i notice is that you are calling methods on inface in the global scope (i.e. outside of main) which cant happen. If they are meant to be called before startup then why not call them right away in main(WinMain)? Well I put them there and it all worked so.....happy now?
    "only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein

  6. #6
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    I didn't understand what you meant? Can you show me what you mean? Just post the snippet of code that you changed.

  7. #7
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    I'm checking the code as we speak and posting its problems

    #1

    You're executing a class's functions outside of any function?
    These where at the top of the source along with the globals,
    Not allowed.

    Code:
    inface.find_current();
    inface.find_century();
    inface.find_dayofyear();
    inface.find_timeofday();
    #2

    I removed these lines from the header because old iostream
    aren't used anymore and it would be crazy to still support them,
    Besides my compiler doesn't like the old rubbish iostreams either

    Code:
    #pragma deprecated(_OLD_IOSTREAMS_ARE_DEPRECATED)
    extern void _OLD_IOSTREAMS_ARE_DEPRECATED();
    Last edited by Travis Dane; 02-18-2003 at 10:09 AM.

  8. #8
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    so where do i have to put the functions?

  9. #9
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640

    Re: ...

    Originally posted by drdroid
    so where do i have to put the functions?
    You mean where to CALL the function as you called them at
    the top of the source, You should call a function within another
    function most of the time. (This is one of the fundementals of c++
    , How can you go wrong here?)

  10. #10
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669
    Now I get these errors. Oh and to that function thing, yah um... I was kind'a out of it last night when i wrote the code... very tired. Thanks.

    Code:
    E:\PROGRAMS\Projects\OpenGL Tests\Graphic OpenGL Stardate\sdopengl\mainsource.cpp(102) : error C2065: 'inface' : undeclared identifier
    E:\PROGRAMS\Projects\OpenGL Tests\Graphic OpenGL Stardate\sdopengl\mainsource.cpp(102) : error C2228: left of '.century' must have class/struct/union type
    E:\PROGRAMS\Projects\OpenGL Tests\Graphic OpenGL Stardate\sdopengl\mainsource.cpp(102) : error C2228: left of '.year' must have class/struct/union type
    E:\PROGRAMS\Projects\OpenGL Tests\Graphic OpenGL Stardate\sdopengl\mainsource.cpp(102) : error C2228: left of '.dayofyear' must have class/struct/union type
    E:\PROGRAMS\Projects\OpenGL Tests\Graphic OpenGL Stardate\sdopengl\mainsource.cpp(102) : error C2228: left of '.outtime' must have class/struct/union type

  11. #11
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Have you removed those 4 function calls? Wich you posted the
    errors of above?

  12. #12
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Question ...

    I need those function calls... why should I get rid of them?

  13. #13
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Oke, So you need them to run at the beginning? Then put the
    calls in WinMain (where the program actually starts and not at
    the top of the source).

  14. #14
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    i've had them there for a while now... that hasn't changed anything.

  15. #15
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640

    Re: ...

    Originally posted by drdroid
    that hasn't changed anything.
    What do mean by that? It still gives errors?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner stuff
    By 94Sniper in forum C Programming
    Replies: 2
    Last Post: 11-29-2007, 04:34 PM
  2. Flushing Stuff In The Console Window
    By mike_g in forum C Programming
    Replies: 5
    Last Post: 06-01-2007, 03:29 PM
  3. Windows Defines - Screwing Stuff Up?
    By Tonto in forum Windows Programming
    Replies: 2
    Last Post: 11-19-2006, 04:53 PM
  4. OpenGL Wierd **** - Order of Drawing Stuff?
    By Tonto in forum Game Programming
    Replies: 9
    Last Post: 11-09-2006, 09:56 PM
  5. Your stuff
    By smog890 in forum C Programming
    Replies: 6
    Last Post: 06-13-2002, 11:50 PM