Results 1 to 9 of 9

Thread: Need help setting up GLUT!!!!

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2000
    Location
    Hanmer
    Posts
    25

    Need help setting up GLUT!!!!

    i posted a previous message reguarding this problem but people claimed to need more info.
    So here it is. These are the error messages when i try to compile it:

    Microsoft(R) Windows 98
    (C)Copyright Microsoft Corp 1981-1998.

    C:\WINDOWS\Desktop>cd\

    C:\>cd borland\bcc55\bin

    C:\Borland\bcc55\Bin>bcc32 c:\test.cpp
    Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
    c:\test.cpp:
    Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    Error: Unresolved external 'glutInitDisplayMode' referenced from C:\BORLAND\BCC5
    5\BIN\TEST.OBJ
    Error: Unresolved external 'glutCreateWindow' referenced from C:\BORLAND\BCC55\B
    IN\TEST.OBJ
    Error: Unresolved external 'glutDisplayFunc' referenced from C:\BORLAND\BCC55\BI
    N\TEST.OBJ
    Error: Unresolved external 'glutMainLoop' referenced from C:\BORLAND\BCC55\BIN\T
    EST.OBJ

    C:\Borland\bcc55\Bin>

    and this is my c++ code:

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

    void RenderScene(void)
    {
    glClear(GL_COLOR_BUFFER_BIT);

    glFlush();
    }
    void SetupRC(void)
    {
    glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
    }
    void main(void)
    {
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutCreateWindow("Simple");
    glutDisplayFunc(RenderScene);

    SetupRC();

    glutMainLoop();
    }

    i have all the GLUT files on a cd that was included with the "OpenGL Superbible" which i purchased but i don't know where to put them.
    I would appreciate any reply to this dumb message since i'm stupid and white cause i need all the help i can get.

    From a poor white kid from the hood called
    Y-T.

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2000
    Location
    Hanmer
    Posts
    25

    Re: Need help setting up GLUT!!!!

    i need help with setting up glut...

  3. #3
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Re: Need help setting up GLUT!!!!

    Take a look at this page on my website :

    http://home.clara.net/paulyg/compfree.htm
    Paul Groves
    [b] pauls opengl page

  4. #4
    Member Contributor
    Join Date
    Feb 2000
    Location
    Brisbane,QLD, Australia
    Posts
    99

    Re: Need help setting up GLUT!!!!

    This works good luck
    ==================
    #include <gl/glut.h>
    #include <gl/gl.h> // Header File For The OpenGL32 Library
    #include <gl/glu.h> // Header File For The GLu32 Library
    #include <gl/glaux.h> // Header File For The GLaux Library
    #include <stdio.h>

    #pragma comment (lib, "glaux.lib") /* link with Win32 GLUT lib */

    void DrawPoly(void)
    {
    glBegin (GL_QUADS);
    glVertex3f (-10.0f, -10.0f, -20.0f);
    glVertex3f (10.0f, -10.0f, -20.0f);
    glVertex3f (10.0f, 10.0f, -20.0f);
    glVertex3f (-10.0f, 10.0f, -20.0f);
    glEnd();

    }

    void init(void)
    {
    LoadGLTextures();
    glClearColor (0.0, 0.0, 0.0, 0.0);
    glShadeModel (GL_FLAT);
    }

    void display(void)
    {
    glClear (GL_COLOR_BUFFER_BIT);
    glColor3f (1.0, 1.0, 1.0);
    glLoadIdentity ();
    DrawPoly();
    glFlush ();
    }

    void reshape (int w, int h)
    {
    glViewport (0, 0, (GLsizei) w, (GLsizei) h);
    glMatrixMode (GL_PROJECTION);
    glLoadIdentity ();
    glFrustum (-1.0, 1.0, -1.0, 1.0, 1.0, 2000.0);
    glMatrixMode (GL_MODELVIEW);
    glLoadIdentity ();
    }

    int main(int argc, char** argv)
    {
    glutInit(&argc, argv);
    glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_ALPHA |GLUT_DEPTH);
    glutInitWindowSize (width, height);
    glutInitWindowPosition ( x, y);
    glutCreateWindow (argv[0]);
    init ();
    glutReshapeFunc(reshape);
    glutDisplayFunc(display);
    glutMainLoop();
    return 0;
    }

  5. #5
    Junior Member Newbie
    Join Date
    May 2000
    Location
    Taipei Taiwan
    Posts
    7

    Re: Need help setting up GLUT!!!!

    You problem may be about the library.

    You didn't tell your compiler where to find
    glut****() .

    add glut32.lib to your link path

  6. #6
    Guest

    Re: Need help setting up GLUT!!!!

    Well, my first recomendation is this:

    If you are using Borland, that's doesn't have MFC, why not test MinGW?

    MinGW (www.mingw.org) is other compiler, greater than Borland's BCC, free (really free...) and is portable (uses GCC from UNIX).

    ========================================

    About your question, you only need add glut32.lib in your compiler "lib" directory and copy glut.h in the compiler's include/gl directory.

  7. #7
    Junior Member Newbie
    Join Date
    Jun 2000
    Location
    Irvin, NJ, USA
    Posts
    1

    Re: Need help setting up GLUT!!!!

    I have had the same problem and just solved it about 10 min ago.

    from what I understand there are two major competing formats for the distribution of LIB's OMF and COFF. Suffice it to say the format of you lib is incompatiable with borland's compiler. The solution to your problem would be to download the orignal dll's and use borland's implib utility to convert them to a compatible format.

    go to the main Opengl.org page, go to downloads and download the header files for glut (that is if you do not have these already). Include in these files you will find the dll's, these are what you want to extract. Once extracted you want to convert them to lib's:
    something like - implib glut.lib glut.dll- will do. Next place these files in the respective directories - borland's library directory- and then you should be all set.

    Another note this article was helpful "Under the Hood" its from microsoft press. To retrive it go to msdn.microsoft.com/library
    in the table of contents on the left scroll to -> periodicals-> periodicals 1996-> MSJ-> March

    This expains a little about the coff and omf formats.

  8. #8
    Junior Member Newbie
    Join Date
    Jun 2000
    Location
    Hanmer
    Posts
    25

    Re: Need help setting up GLUT!!!!

    Thanx alot KM!!! i've been trying to set up GLUT for the past month! now i can finally start using opengl. I did exacly what u said and it worked the first time i tried it!

    Thanx,

    Y-T

  9. #9
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    472

    Re: Need help setting up GLUT!!!!

    Originally posted by ASK:

    MinGW (www.mingw.org) is other compiler, greater than Borland's BCC, free (really free...) and is portable (uses GCC from UNIX).
    [/B]
    err... forgive me for mentioning but Borland's command line compiler is completely free as well. As for portability, the compiler you use isn't going to help you with that, thats down to the programmer. I have no problems porting code between Irix, Linux and Win32, and I'm a mere borland user....

Similar Threads

  1. Help setting up VBO
    By tnecniv in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-15-2011, 02:26 AM
  2. setting max frame rate with glut?
    By Rad in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-07-2003, 02:06 PM
  3. Setting up GLUT skeleton in Borland 6.0
    By Suf in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 04-29-2003, 03:34 AM
  4. Setting up a GLUT Enviornment in Windows?
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-11-2002, 02:33 AM
  5. Setting everything up
    By Zeus_666 in forum OpenGL: Linux
    Replies: 1
    Last Post: 06-18-2001, 08:28 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