Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: unreferenced items in glut.h

  1. #1
    Junior Member Newbie BertusDries's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    11

    unreferenced items in glut.h

    I'm new to OpenGL. I am trying to run a program running on a UBUNTU operating system on my Windows 7 system. In the mean time I have solved a lot of problems with that partly because I want to keep my system neat which means that I want to have programs on a special position (on the D: partition).
    I am using the GNAT Programming Studio. When I build the program I get about sixty errors all in the form of:

    undefined reference to `__glutCreateMenuWithExit
    This one and two others even in glut.h (which are twice mentioned in the list of errors. The others are in a file which #includes only glut.h How can I solve this

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: unreferenced items in glut.h

    Try freeglut http://freeglut.sourceforge.net/. I think the glut version u have is old.
    Regards,
    Mobeen

  3. #3
    Junior Member Newbie BertusDries's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    11

    Re: unreferenced items in glut.h

    I have version 3.6.7

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: unreferenced items in glut.h

    Quote Originally Posted by BertusDries
    I have version 3.6.7
    glut version 3.7.6 was released in Nov 2001.

    Get freeglut its much more recent and has code for setting up OpenGL3.0 and above.
    Regards,
    Mobeen

  5. #5
    Junior Member Newbie BertusDries's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    11

    Re: unreferenced items in glut.h

    In the mean time I have tried freeglut but I get the same results

  6. #6
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: unreferenced items in glut.h

    Could u post the minimal freeglut code here and what errors it gives u?
    Regards,
    Mobeen

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    592

    Re: unreferenced items in glut.h

    Obviously, you don't link with glut, whatever version you have. Try -lglut switch.

  8. #8
    Junior Member Newbie BertusDries's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    11

    Re: unreferenced items in glut.h

    This is in glut.h of freeglut 2.1.4
    An example of the error is:

    614:1 undefined reference to `_imp____glutCreateMenuWithExit@8

  9. #9
    Junior Member Newbie BertusDries's Avatar
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    11

    Re: unreferenced items in glut.h

    I have already tried the -lglut32 switch but that didn't wotk either, neither did the -L switch. Both switches are linker options and as far as I can see the problem is somewhere in de compiler within GPS.

  10. #10
    Senior Member Regular Contributor
    Join Date
    Mar 2007
    Location
    CA
    Posts
    408

    Re: unreferenced items in glut.h

    The error is not related to the header at all whether it is from glut or freeglut. You are not telling your linker to use the libglut.* in GNAT correctly. Not being familar with GNAT IDE, a simple test is to go to the command line and do what was suggested earlier (specify -lglut) ie
    Code :
    gcc main.c -lglut
    assuming your simple glut program is called main.c this should tell the linker to link to the glut library and produce a.out. This is what GNAT will do behind the scenes anyway.

    Follow up -- are you in linux or windows/mingw? On linux use -lglut but on windows/mingw use "-lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32"

    also take a look at the suggestion at Post103685 which uses #define GLUT_DISABLE_ATEXIT_HACK

Page 1 of 2 12 LastLast

Similar Threads

  1. Maximum number of work-items
    By rabben in forum OpenCL
    Replies: 5
    Last Post: 11-27-2012, 03:18 AM
  2. question on work-items?
    By Arian in forum OpenCL
    Replies: 6
    Last Post: 07-10-2012, 01:51 AM
  3. GTX 560 - How much work-items i set?
    By luizdrumond in forum OpenCL
    Replies: 4
    Last Post: 06-22-2012, 11:58 AM
  4. Replies: 1
    Last Post: 05-31-2012, 05:38 PM
  5. detaching menu items
    By stanigator in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-06-2009, 03:32 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