Results 1 to 23 of 23

Thread: OpenGL Problem

  1. #1

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127

    OpenGL Problem

    Where do i install the opengl sdk(its self extracting). I tried a few diff. places and still cant make any opengl programs. Anyone else have a problem with missing dll's ?

  2. #2
    Zaei
    Guest
    Move the DLLs into either your Windows\System32 directory, or into your program's directory.

    Z.

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    Re: OpenGL Problem

    Originally posted by slx47
    Where do i install the opengl sdk(its self extracting). I tried a few diff. places and still cant make any opengl programs. Anyone else have a problem with missing dll's ?
    OpenGL SDK? The Silicon Graphics one?

    That's been unsupported by them for a while now. Why can't you just use the normal documentation?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    I should say im using windows xp. Does anyone know if gl has problems running on xp ?

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    OpenGL runs pretty much perfectly on everything as long as there are drivers for it.

    http://www.parksie.net/gl2.zip

    Does this run at an acceptable speed?

    What graphics card do you have?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127

    k

    i know i have all the dll's,.h,.lib files in the right spot. Now when i compile some on my programs it compiles but it has problems linking. The linker has problems with the functions under main()

    Code:

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


    // Define a constant for the value of PI
    #define GL_PI 3.1415f

    // Rotation amounts
    static GLfloat xRot = 0.0f;
    static GLfloat yRot = 0.0f;


    // Called to draw scene
    void RenderScene(void)
    {
    GLfloat x,y,z,angle; // Storeage for coordinates and angles

    // Clear the window with current clearing color
    glClear(GL_COLOR_BUFFER_BIT);

    // Save matrix state and do the rotation
    glPushMatrix();
    glRotatef(xRot, 1.0f, 0.0f, 0.0f);
    glRotatef(yRot, 0.0f, 1.0f, 0.0f);

    // Call only once for all remaining points
    glBegin(GL_LINES);

    z = 0.0f;
    for(angle = 0.0f; angle <= GL_PI*3.0f; angle += 0.5f)
    {
    // Top half of the circle
    x = 50.0f*sin(angle);
    y = 50.0f*cos(angle);
    glVertex3f(x, y, z);

    // Bottom half of the circle
    x = 50.0f*sin(angle+3.1415f);
    y = 50.0f*cos(angle+3.1415f);
    glVertex3f(x, y, z);
    }

    // Done drawing points
    glEnd();


    // Restore transformations
    glPopMatrix();

    // Flush drawing commands
    glutSwapBuffers();
    }

    // This function does any needed initialization on the rendering
    // context.
    void SetupRC()
    {
    // Black background
    glClearColor(0.0f, 0.0f, 0.0f, 1.0f );

    // Set drawing color to green
    glColor3f(0.0f, 1.0f, 0.0f);
    }

    void SpecialKeys(int key, int x, int y)
    {
    if(key == GLUT_KEY_UP)
    xRot-= 5.0f;

    if(key == GLUT_KEY_DOWN)
    xRot += 5.0f;

    if(key == GLUT_KEY_LEFT)
    yRot -= 5.0f;

    if(key == GLUT_KEY_RIGHT)
    yRot += 5.0f;

    if(key > 356.0f)
    xRot = 0.0f;

    if(key < -1.0f)
    xRot = 355.0f;

    if(key > 356.0f)
    yRot = 0.0f;

    if(key < -1.0f)
    yRot = 355.0f;

    // Refresh the Window
    glutPostRedisplay();
    }


    void ChangeSize(int w, int h)
    {
    GLfloat nRange = 100.0f;

    // Prevent a divide by zero
    if(h == 0)
    h = 1;

    // Set Viewport to window dimensions
    glViewport(0, 0, w, h);

    // Reset coordinate system
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

    // Establish clipping volume (left, right, bottom, top, near, far)
    if (w <= h)
    glOrtho (-nRange, nRange, -nRange*h/w, nRange*h/w, -nRange, nRange);
    else
    glOrtho (-nRange*w/h, nRange*w/h, -nRange, nRange, -nRange, nRange);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    }

    int main(int argc, char* argv[])
    {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
    glutCreateWindow("Lines Example");
    glutReshapeFunc(ChangeSize);
    glutSpecialFunc(SpecialKeys);
    glutDisplayFunc(RenderScene);
    SetupRC();
    glutMainLoop();

    return 0;
    }

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Do you have glut32.lib?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    I checked and i have all the right files in the right places. The links says this:

    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'

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You need to make sure you're linking with opengl32.lib and glut32.lib.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  10. #10

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    I think the lib files should work i dont why it isnt working !!!

  11. #11
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    What compiler?

    Under MSVC, go to Project Settings->Linker, and add them to the list.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  12. #12

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    i use: dec 4 c++ for a compiler. I also tried code warrior and it doesnt work for that either.

  13. #13
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Oh.

    Are the .lib files in the directory the linker will look in? Also the glut32.lib file was made with the latest Microsoft linker so that might affect it.

    You're probably best off downloading GLUT 3.7 and compiling it yourself to get a .lib out of it.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  14. #14

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    im not sure what it is.

  15. #15
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You'd need to check the compiler/linker documentation for more details, I really can't help much further (happy VC user here)
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  16. #16

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    ive just tried vc and that didnt work either. Im not sure if its windows xp or not but no compiler will work with it.

  17. #17
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Do you have the Platform SDK? You probably need the linker tools from that.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  18. #18

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    no i dont have the platform sdk.

  19. #19
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Download it then

    It's extremely useful; I think you need the build tools as well (gaaaaawd why can't people just get along and write files that work with something else!!)
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  20. #20

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    do you know where i can get it from ?

  21. #21
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Ummm...Microsoft, who else?

    http://msdn.microsoft.com/downloads
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  22. #22

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    the site

    there is no option to download it, you can only order a cd for 8.00 is there another way to download ?

  23. #23
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    http://www.microsoft.com/msdownload/...sdk/sdkupdate/

    If you want to keep with Dev-C++ your best bet is to generate the libraries using that...I don't have a copy though.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

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



Click Here to Expand Forum to Full Width