Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Open Gl problem

  1. #1
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post

    Open Gl problem

    i encountered a problem while programing with openGL using vc 2003
    if i give
    #include <GL/glut.h>
    #include <iostream>
    its giving compile time error
    Compiling...
    main.cpp
    D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(256) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs
    D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\glut.h(146) : see declaration of 'exit'

    Build log was saved at "file://d:\Documents and Settings\Adarsha\My Documents\Visual Studio Projects\line-y=mxplusc\line-y=mxplusc\Debug\BuildLog.htm"
    line-y=mxplusc - 1 error(s), 0 warning(s)

    if i interchange to
    #include <iostream>
    #include <GL/glut.h>
    i can then compile it

    i am relatively new to openGL so can anone help explain
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs

  • #2
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post
    can no one answer this ... ???

    any small idea wat the problem is about...?
    i have downloaded the official glut.h file
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs

  • #3
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Sounds like the same thing is being included twice, but the include inside of glut.h probably uses #if and #else directives. For example:
    Code:
    #ifndef IOSTREAM_H
    #include <iostream>
    #endif
    Of course, it sounds like something similar to that is being done for the function exit() inside of glut, but not in iostream.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •