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 4 of 4

Thread: trying to build app using glut

  1. #1
    Intern Contributor
    Join Date
    Jan 2004
    Location
    Hoboken,NJ,USA
    Posts
    60

    trying to build app using glut

    I downloaded a nehe demo and tried to build under Mac OS 10.4 (intel)
    I'm building using g++ 4.0.1, and since the demo used code warrior, and had no makefile, I have no idea what it did, but since I know how to build on Linux and Windows, I figured it should be easy....
    The problem is, despite having something called GLUT.Framework loaded on the system, I don't seem to have a glut library to link to. I searched, and there is no libglut.a, or libglut.dylib that I can see. I did find GL, but I'm still getting undefined symbols _glutMainLoop, etc. Can anyone explain what I'm doing wrong?

    Here's the makefile I put together:
    INC=-I/usr/X11R6/include/GL -I/usr/X11R6/include -I/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/GLUT.framework/Versions/A/Headers/
    LIB=-L/usr/X11R6/lib -lGL
    lesson05: main.c
    gcc -g $(INC) main.c $(LIB)

  2. #2
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    676

    Re: trying to build app using glut

    Forget everything you know about X11.

    gcc main.c -framework OpenGL -framework GLUT

    and change
    #include <GL/gl.h>
    #include <GL/glut.h>
    to
    #include <OpenGL/gl.h>
    #include <GLUT/glut.h>

  3. #3
    Intern Contributor
    Join Date
    Jan 2004
    Location
    Hoboken,NJ,USA
    Posts
    60

    Re: trying to build app using glut

    Thanks, that's just the ticket!

  4. #4
    Junior Member Regular Contributor
    Join Date
    Nov 2007
    Location
    London UK
    Posts
    242

    Re: trying to build app using glut

    Have you tried downloading the Cocoa sourcecode for any of the projects?
    I'm interested in trying some of the Nehe OpenGL tutorials myself (with a view to possibly translating some of them into plugins for Quartz Composer). I have a lot to learn before I get to that stage, however.

    alx

Posting Permissions

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