Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: GLUT link error !

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2002
    Location
    Trabzon,Turkey
    Posts
    5

    GLUT link error !

    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:
    **************************
    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    Debug/opengl_sample.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
    ***************************

    so what is the matter and solution for it?
    (i am using visual c++ 6.0 compiler under win2K)

    thank you..

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Posts
    748

    Re: GLUT link error !

    There is a lot of solutions like: reading the manuals, reading tutorials on how to set up a window with glut, learning how to use VC++ properly, posting to the correct forum (ie. not the advanced one), and optionnally creating the correct project type in VC++ (a console application) ?

    Y.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: GLUT link error !

    What Ysaneya said. This is not an advanced question, nor is it even an OpenGL question. Thread closed.

    -- Tom

  4. #4
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: GLUT link error !

    Moving to the toolkits forum.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Bangalore,India
    Posts
    24

    Re: GLUT link error !

    Is the project a Win32 console project or a Win32 Application project
    Yup, that's me!!

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    India
    Posts
    5

    Re: GLUT link error !

    HI ak

    most simply speaking, I guess you are trying to compile a project that you've set to be of type "Win32 application" whereas the code you've keyed in is for a "Win32 console applictaion"

    if you've worked on any version of c ever before you must be knowing that "main" is the entry point for a program. as far as windows is concerned, the entry point goes by the name of "WinMain". theres where your compiler gets confused. you must've specified an application of type "Win32 Application" so your compiler is looking for a "WinMain" rather than "main".

    i hope things muct be clear now, try creating a console application and use the same code.

    Girish Sarwal
    Platinum Rogue

Posting Permissions

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