Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: problem with opengl in dev-c++ and vc ..please help

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    Calcutta,West Bengal,India
    Posts
    13

    problem with opengl in dev-c++ and vc ..please help

    I using this basic program in Opengl

    #include <windows.h>
    #include <gl\glut.h>

    void init(void);
    void display(void);

    int main(int argc, char** argv)
    {
    glutInit (&argc, argv) ;
    glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB) ;
    glutInitWindowSize (400, 100) ;
    glutInitWindowPosition (100, 100) ;
    glutCreateWindow ("First Chapter - Opening an OpenGL Window") ;

    init() ;
    glutDisplayFunc (display) ;
    glutMainLoop () ;
    return 0 ;
    }

    void init(void)
    {
    glClearColor(1.0, 1.0, 1.0, 0.0) ;
    glShadeModel(GL_FLAT) ;
    }

    void display(void)
    {
    glClear(GL_COLOR_BUFFER_BIT) ;
    glutSwapBuffers() ;
    }

    1. In VC++ I have changed the settings to add appropriate libs
    winmm.lib,opengl32.lib, glu32.lib, glaux.lib ,glut32.lib...but
    when I try to run I get error as

    "Cant open include file gl\glut.h" what is the problem?

    2. This same program when I try to run in Dev-c++ and enter
    proper libs too it compiles successfully but gives out
    error as "The TEST_001.EXE file is linked to missing export
    GLUT32.DLL:_glutCreateMenuWithExit.

    what can i do run the program and future programs?

    I have glu32.dll and glut32.dll in my
    system and system32 dir too.

    thanks in advance,
    anindya

  2. #2
    Guest

    Re: problem with opengl in dev-c++ and vc ..please help

    i think I replied to this earlier, you need to set up your compiler correctly. When you import using the <> with include, it looks in a compiler specific directory for that header. Go there and make sure to make a folder called GL then put those headers in it so the compiler can see it.

  3. #3
    Member Newbie
    Join Date
    Nov 2002
    Location
    bucharest, romania
    Posts
    35

    Re: problem with opengl in dev-c++ and vc ..please help

    It may look bizarre, but when I build projects with glut in VC6, I don't need to include opengl32.lib, neither glu32.lib, nor glut32.lib.I just make a console project and get rid of console window.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: problem with opengl in dev-c++ and vc ..please help

    Zork:
    Same for me. Although I don't use a console application but a win32 project.
    Anyway I think the glut.h has all the other headers included for you.
    I may not be good looking but I sure am dumb.

  5. #5
    Member Newbie
    Join Date
    Nov 2002
    Location
    bucharest, romania
    Posts
    35

    Re: problem with opengl in dev-c++ and vc ..please help

    So, you can do some OpenGL graphics with glut and use a win32 project?I didn't know.How you do this?

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: problem with opengl in dev-c++ and vc ..please help

    Glut doesn't come with VC++, so it sounds like you need to download it. Place the header in the vc++/include/GL folder, the .libs in vc++/lib folder, and the .dlls into your windows system or system32 directory.

    About not needing to add the .libs when using glut, this is due to the fact that the glut.h has #pragmas that will essentially include the .lib files into the project for you.
    Deiussum
    Software Engineer and OpenGL enthusiast

  7. #7
    Member Newbie
    Join Date
    Nov 2002
    Location
    bucharest, romania
    Posts
    35

    Re: problem with opengl in dev-c++ and vc ..please help

    Smart thing, that glut, isn't it?

  8. #8
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: problem with opengl in dev-c++ and vc ..please help

    errrr well.
    Actually I have set up my OpenGL-window without using glut. I just included the glut.h in my project.
    Now I am not quite sure what you mean.
    Of course you can draw with OpenGL without glut, but then you do exactly that, namely not using glut.
    ummm I messed it up, what do you mean?
    I may not be good looking but I sure am dumb.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: problem with opengl in dev-c++ and vc ..please help

    Take a look at glut.h. You will see lines that look like so. (Off the top of my head)


    #pragma ("lib", "glut32.lib");
    #pragma ("lib", "opengl32.lib");
    #pragma ("lib", "glu32.lib");
    #pragma ("lib", "winmm.lib");

    #pragmas are something that is compiler-specific, but I believe the above works both for VC++ and Borland. It's basially an alternative way of including libraries w/o having to go to the project settings to add them to the linker options.
    Deiussum
    Software Engineer and OpenGL enthusiast

  10. #10
    Member Newbie
    Join Date
    Nov 2002
    Location
    bucharest, romania
    Posts
    35

    Re: problem with opengl in dev-c++ and vc ..please help

    I am using just glut,not OGL with win32, and I don't know if glut can be used in a win32 project without int blahblahblah winmain and blahblahblah wndproc.Can it?

Page 1 of 2 12 LastLast

Similar Threads

  1. OpenGL Problem
    By pczone in forum OpenGL ES
    Replies: 1
    Last Post: 06-05-2009, 09:22 AM
  2. Replies: 4
    Last Post: 09-27-2004, 06:27 AM
  3. opengl problem
    By c0mputar in forum OpenGL: User Software
    Replies: 1
    Last Post: 01-09-2004, 05:15 AM
  4. Replies: 1
    Last Post: 01-19-2003, 10:26 AM
  5. Big problem with OpenGL
    By in forum OpenGL: User Software
    Replies: 4
    Last Post: 08-09-2002, 02:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean