Results 1 to 3 of 3

Thread: strange MSVC errors

  1. #1
    Member Contributor
    Join Date
    Jul 2001
    Location
    Camarillo, CA, USA
    Posts
    58

    strange MSVC errors

    everything is set up fine.

    I get an error that says

    Linking...
    LINK : warning LNK4089: all references to "OPENGL32.dll" discarded by /OPT:REF

    when I try to build (it compiles fine) the following code:

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

    //FUNCTION DECLARATIONS
    void initGL(void);
    void keyDown(unsigned char key, int x, int y);

    //MAIN FUNCTION
    void main(int argc, char **argv){
    glutInit(&argc, argv);
    glutInitDisplayMode(GL_DEPTH|GL_DOUBLE|GL_RGBA);
    glutInitWindowPosition(1,1);
    glutInitWindowSize(320,320);
    glutFullScreen();
    glutKeyboardFunc(keyDown);
    glutMainLoop();
    }

    //KEYPRESS FUNCTION
    void keyDown(unsigned char key, int x, int y){
    switch(key){
    case 27: exit(1); break;
    default: break;
    }
    }

    //RENDER SCENE
    void initGL(void){
    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_LIGHTING);

    //Now make an instance of light, and declare its position
    glEnable(GL_LIGHT1); static GLfloat Light1Pos[]={0.0,0.0,1.0, 0.0};

    glLightfv(GL_LIGHT1, GL_POSITION, Light1Pos);
    glColor4f(1.0f, 1.0f, 1.0f, 0.5f);
    glBegin(GL_QUADS);
    glVertex3f(-5.0, 5.0, 0.0);
    glVertex3f(-5.0,-5.0, 0.0);
    glVertex3f( 5.0, 5.0, 0.0);
    glVertex3f( 5.0,-5.0, 0.0);
    glEnd();
    glutSwapBuffers();
    }

    What exactly is it saying?
    PROGRAMMERS SHALL RULE THE WORLD

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    15

    Re: strange MSVC errors

    Straight out of MSDN:

    Linker Tools Warning LNK4089
    all references to "dynamic-link library" discarded by /OPT:REF

    The linker discarded all packaged functions that referenced exports in dynamic-link library. As a result, dynamic-link library and its import library are unneeded.


    Also straight out of MSDN:


    This option controls the optimizations that LINK performs during a build. Optimizations generally decrease the image size and increase the program speed, at a cost of increased link time.

    Use /OPT:REF to eliminate functions and/or data that is never referenced.


    The moral of the story: When using MSVC, MSDN is your friend.

    SL

  3. #3
    Senior Member Regular Contributor
    Join Date
    Dec 2000
    Location
    Slovak Republic( Slovakia )
    Posts
    110

    Re: strange MSVC errors

    Try to select the debug(linker) from RELEASE to DEBUG.

Similar Threads

  1. Replies: 0
    Last Post: 11-09-2005, 10:24 PM
  2. Lookup-Texture instead of pow causes strange gfx errors
    By namespace in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 12-13-2004, 11:17 AM
  3. Really strange GL errors
    By imported_Ffelagund in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 12-11-2004, 03:21 PM
  4. BC++ vs MSVC++
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-13-2002, 07:22 AM
  5. Strange errors in all Open-gl based games
    By in forum OpenGL: User Software
    Replies: 0
    Last Post: 04-29-2001, 12:50 PM

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