Results 1 to 3 of 3

Thread: link error, help

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2004
    Location
    china
    Posts
    4

    link error, help

    hi,
    below is a simple code sample :
    *************************************
    #include <GL\glut.h>
    void display (void);
    void main (int argc, char **argv)
    {
    glutInit (&argc, argv);
    glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize (500, 500);
    glutInitWindowPosition (0,0);
    glutCreateWindow ("OpenGL");
    glutDisplayFunc(display);
    glutMainLoop();
    }
    void display (void)
    {
    }
    *************************************
    and following is a link error concerning the above code sample:
    **************************
    Linking...
    PRIM.OBJ : error LNK2001: unresolved external symbol ___glutInitWithExit@12
    PRIM.OBJ : error LNK2001: unresolved external symbol ___glutCreateWindowWithExit@8
    Debug/PRIM.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.
    ***************************
    so what is the matter and solution for it?
    (i am using visual c++ 6.0 compiler under winXP,
    I've add glut32.dll to C:\windows/system32.The project is win32 console.
    link/Project Options:
    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glut32.lib glaux.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/PRIM.pdb" /debug /machine:I386 /out:"Debug/PRIM.exe" /pdbtype:sept
    c&c++/project Options:
    /nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/PRIM.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
    thank you..

  2. #2
    Senior Member Regular Contributor CrazyButcher's Avatar
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    401

    Re: link error, help

    not sure but try

    #define GLUT_DISABLE_ATEXIT_HACK

    before you include glut.h

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2004
    Location
    china
    Posts
    4

    Re: link error, help

    Originally posted by CrazyButcher:
    not sure but try

    #define GLUT_DISABLE_ATEXIT_HACK

    before you include glut.h
    Many thanks, it's ok.

Similar Threads

  1. link error
    By Savalia in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-26-2009, 02:28 AM
  2. link error!
    By orchis in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 10-15-2004, 07:52 AM
  3. Link Error
    By neru in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-06-2004, 05:22 AM
  4. link error
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-19-2001, 06:03 PM
  5. A Link error
    By 2 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-26-2001, 09:18 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