Thread: configurating dev-c++ for openGL

  1. #1
    Registered User zell's Avatar
    Join Date
    Jan 2005
    Posts
    37

    configurating dev-c++ for openGL

    Code:
    #include <glut.h>
    
    void mydisplay()
    {
        glClear(GL_COLOR_BUFFER_BIT) ;
        glBegin(GL_POLYGON) ;
            glVertex2f(-0.5, -0.5) ;
            glVertex2f(-0.5, 0.5) ;
            glVertex2f(0.5, 0.5) ;
            glVertex2f(0.5, -0.5) ;
        glEnd() ;
        glFlush() ;
    }
    
    int main(int argc, char** argv)
    {
        glutCreateWindow("simple") ;
        glutDisplayFunc(mydisplay) ;
        glutMainLoop() ;
    }
    i have the above code, but i have error compiling
    i have the below error
    glut.h: No such file or directory.

    anyone can teach me how to do the linker and where to copy the openGL lib to?

    thanks in advance


    also, i wanna try using cygwin to do the compiling also
    so same thing, where do i do the linker and where to copy the openGL lib to?
    learning c programming for operating systems...
    learning openGL for graphics design...

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    you have to include the include path for opengl. for DevC++, they install that in the DevC++ directory under gcc/Include/gl
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Registered User zell's Avatar
    Join Date
    Jan 2005
    Posts
    37
    Quote Originally Posted by FillYourBrain
    you have to include the include path for opengl. for DevC++, they install that in the DevC++ directory under gcc/Include/gl
    i dun get it
    so wat i am supposed to do?
    learning c programming for operating systems...
    learning openGL for graphics design...

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    a compiler option. look through your menus. alternatively change your include line to:

    #include <gl\glut.h>

    because opengl was installed in a subdirectory of your gcc main include directory
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    6
    hmm i wanted to know this as well, thanx for clearing that up

  6. #6
    Registered User xxxrugby's Avatar
    Join Date
    Jan 2005
    Posts
    178
    I have DevC++ and it doesent have
    Code:
    #include <GL/glut.h>
    I downlaod glut.h and put it into directory
    Code:
    include/GL/
    , I am try to compile above code but still doesent work.
    I am complete new to this.
    Sorry for spelling errors, not English!
    xxxrugby: "All Human Race Will Die From My Hand!"
    xxxrugby: "We are all philosophers, when question is about politics!"

  7. #7
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    you should probably just go ahead and do a full install of the latest DevC++ It installs it I can assure you
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  8. #8
    Registered User xxxrugby's Avatar
    Join Date
    Jan 2005
    Posts
    178
    I dont know, I just now Download and Install latest DevC++. Still doesent have <GL/glut.h> so I went to DevC++ and looks into all directory to find glut.h but no luck. Can you rather tell me how to put inside the DevC++ all necessery files of Glut.h.
    I download
    GLUT 3.7.6 bin from http://www.xmission.com/~nate/glut/glut-3.7.6-bin.zip
    and GLUT 3.7.6 src. from http://www.xmission.com/~nate/glut/glut-3.7.6-src.zip
    But dont know what with that. Where to put all that files.
    Curently working on Windows!
    I know it is silly question but I dont know how to do it!

    I went on DevC++ chect for upgrades and there it is find glut.h, But I then I went to download it, and all freeze on half way. I will try agin, maybe it will work.
    It install glut.h and openglut.h, and now from above code i got losts of ->linker error <- is that above code wrong or I have to do something more with glut.h
    Last edited by xxxrugby; 01-31-2005 at 06:43 PM.
    Sorry for spelling errors, not English!
    xxxrugby: "All Human Race Will Die From My Hand!"
    xxxrugby: "We are all philosophers, when question is about politics!"

  9. #9
    Trolley boy JackGL's Avatar
    Join Date
    Jan 2005
    Location
    UK
    Posts
    15
    Quote Originally Posted by xxxrugby
    I downlaod glut.h and put it into directory
    Code:
    include/GL/
    , I am try to compile above code but still doesent work.
    Could it be that you haven't linked it to the OpenGL libraries?

    Or does GLUT do this for you? I've never really used GLUT.

  10. #10
    ~viaxd() viaxd's Avatar
    Join Date
    Aug 2003
    Posts
    246
    hey, here's what i found about using glut in Dev-C++:
    http://www.physics.buffalo.edu/phy41...andDevC++.html
    :wq

  11. #11
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    looks like im late to the scene, anyway you forgot to init glut....

    Code:
    glutInit(argc, argv);

  12. #12
    Registered User xxxrugby's Avatar
    Join Date
    Jan 2005
    Posts
    178
    Thank you "viaxd" about the page. I do that from the page and is working! Thank you!
    Also "jackGL" you are write that I havent link to the glut.h librarie.!
    Thanks!
    Sorry for spelling errors, not English!
    xxxrugby: "All Human Race Will Die From My Hand!"
    xxxrugby: "We are all philosophers, when question is about politics!"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 01:05 AM
  2. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 08:43 PM
  3. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 3
    Last Post: 03-08-2004, 08:47 PM
  4. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 1
    Last Post: 03-08-2004, 05:19 PM
  5. DEV C++ Limitations?
    By Kirdra in forum Game Programming
    Replies: 3
    Last Post: 09-09-2002, 09:40 PM