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

Thread: Opengl and windows xp

  1. #1
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    6

    Opengl and windows xp

    I cant compile my programs right. I am using windows xp. I was wondering if it had problems on xp or it doesnt run at all on xp ?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: Opengl and windows xp

    OpenGL both compiles and runs on XP.

    What compiler are you using, what errors are you seeing, are you able to compile on other machines, etc....

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

    Re: Opengl and windows xp

    More info is needed to answer your question... Like... what compiler do you use? What errors you are getting? What is the air speed velocity of an unladen sparrow?
    Deiussum
    Software Engineer and OpenGL enthusiast

  4. #4
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    6

    Re: Opengl and windows xp

    Ok im using: dev 4 c++

    and heres my problem:

    the linker has a problem:
    c:\documents and settings\ralph\my documents\untitled1.o(.text+0xf):untitled1.cpp: undefined reference to `glClear@4'
    c:\documents and settings\ralph\my documents\untitled1.o(.text+0x17):untitled1.cpp: undefined reference to `glFlush@0'
    c:\documents and settings\ralph\my documents\untitled1.o(.text+0x39):untitled1.cpp: undefined reference to `glClearColor@16'
    c:\documents and settings\ralph\my documents\untitled1.o(.text+0x5d):untitled1.cpp: undefined reference to `glutInitDisplayMode@4'
    c:\documents and settings\ralph\my documents\untitled1.o(.text+0x6d):untitled1.cpp: undefined reference to `glutCreateWindow@4'
    c:\documents and settings\ralph\my documents\untitled1.o(.text+0x7d):untitled1.cpp: undefined reference to `glutDisplayFunc@4'
    c:\documents and settings\ralph\my documents\untitled1.o(.text+0x8a):untitled1.cpp: undefined reference to `glutMainLoop@0'


    and my code is:

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

    // Called to draw scene
    void RenderScene(void)
    {
    // Clear the window with current clearing color
    glClear(GL_COLOR_BUFFER_BIT);


    // Flush drawing commands
    glFlush();
    }

    // Setup the rendering state
    void SetupRC(void)
    {
    glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
    }


    // Main program entry point
    void main(void)
    {
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutCreateWindow("Simple");
    glutDisplayFunc(RenderScene);

    SetupRC();

    glutMainLoop();
    }



    [This message has been edited by slx47 (edited 05-08-2002).]

  5. #5
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    133

    Re: Opengl and windows xp

    "the linker has a problem:"
    Not the compiler. Your not linking
    to the GL, and GLUT libs.

    Try adding:

    #pragma comment (lib, "opengl32.lib")
    #pragma comment (lib, "glu32.lib")
    #pragma comment (lib, "glut32.lib")

    And make sure you have GLUT installed
    on your machine.

    Regards,
    Jim
    --
    Jim Mathies http://www.mathies.com/

    \"The best way to predict the future is to invent it."

  6. #6
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    6

    Re: Opengl and windows xp

    that didnt do anything !

  7. #7
    Member Contributor
    Join Date
    Jun 2001
    Posts
    64

    Re: Opengl and windows xp

    What he's saying is that you need more than just OpenGL headers.

    You need to add the glut32.lib and glu32.lib files to your project.

    Find them on your hard drive. They should be in the MSVC++ folders
    somewhere.

    If you don't have them, then search the web for them.

    [This message has been edited by Syslock (edited 05-09-2002).]

  8. #8
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    6

    Re: Opengl and windows xp

    ok that helped, but i still have a few little problems, I am using dev-C++.

    the linker says:

    C:\DEV-C_~1\Bin\ld.exe: C:\Dev-C++\Lib\OPENGL32.LIB(OPENGL32.dll): warning: ignoring duplicate section `.text'
    C:\DEV-C_~1\Bin\ld.exe: C:\Dev-C++\Lib\OPENGL32.LIB(OPENGL32.dll): warning: ignoring duplicate section `.idata$5'
    C:\DEV-C_~1\Bin\ld.exe: C:\Dev-C++\Lib\OPENGL32.LIB(OPENGL32.dll): warning: ignoring duplicate section `.text'
    C:\DEV-C_~1\Bin\ld.exe: C:\Dev-C++\Lib\OPENGL32.LIB(OPENGL32.dll): warning: ignoring duplicate section `.idata$5'
    C:\Dev-C++\Lib\glut32.lib: file not recognized: File format not recognized

    and my code is:

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

    // Called to draw scene
    void RenderScene(void)
    {
    // Clear the window with current clearing color
    glClear(GL_COLOR_BUFFER_BIT);


    // Flush drawing commands
    glFlush();
    }

    // Setup the rendering state
    void SetupRC(void)
    {
    glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
    }


    // Main program entry point
    void main(void)
    {
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutCreateWindow("Simple");
    glutDisplayFunc(RenderScene);

    SetupRC();

    glutMainLoop();
    }

  9. #9
    Senior Member Regular Contributor
    Join Date
    Dec 2001
    Location
    London, England
    Posts
    160

    Re: Opengl and windows xp

    I suspect you have found .lib files for microsoft vc++ rather than your own dev c++.
    You need to find .lib files generated for dev c++, so they will not be found in the MSVC folder.
    btw, adding

    #pragma comment(lib,...)

    does not work, since that is MS VC++ specific.

  10. #10
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: Opengl and windows xp

    Hi !

    DevCPP uses the MinGW32 compiler (that's the gcc compiler for Windows), so you need to use .a files not .lib files, your compiler does not work with the normal .lib files.

    Mikael

Page 1 of 2 12 LastLast

Similar Threads

  1. openGL works on windows 2000 but not windows XP
    By Wondering Programmer in forum OpenGL: Windows
    Replies: 2
    Last Post: 04-04-2006, 07:00 AM
  2. Replies: 4
    Last Post: 06-15-2005, 06:35 AM
  3. Real Time Mapping of Windows NT Windows Onto an OpenGL object
    By pmilholl in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 08-08-2002, 03:42 PM
  4. Replies: 1
    Last Post: 06-09-2001, 09:11 AM
  5. where can i find the opengl programming for windows 95 and windows NT
    By victorswan in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-01-2001, 07:14 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