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

Thread: newbie question about Mach-O and OpenGL/GLUT

  1. #1
    Guest

    newbie question about Mach-O and OpenGL/GLUT

    Using CodeWarrior 8 I have no problems compiling a double-clickable OpenGL GLUT app that I wrote in C for Carbon. But I want to compile the app, not using the Carbon CFM object format, but Mach-O object format, so that I can start the program from the Terminal and use third-party libraries in the .a (archive of object files) format.

    Problem is, where are the Mach-O libaries for Open-GL and Glut? They're not in Open GL SDK 1.2, or in /usr/lib. I see frameworks in /System/Library/Frameworks for:

    GLUT.framework
    OpenGL.framework

    but the problem is that I only know C, and not C++, so I'd rather just use #include and be done with it...

    Can anybody point me in the right direction with this? Thanks...

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2001
    Location
    Wellington, New Zealand
    Posts
    548

    Re: newbie question about Mach-O and OpenGL/GLUT

    Eh?

    Rather than your CFM OpenGL, GLU and GLUT libs you need the OpenGL, GLUT and Cocoa frameworks.

    Rather than including <GL/gl.h> and <GL/glut.h>, you need to include <OpenGL/gl.h> and <GLUT/glut.h>.

    None of the rest of your code need change.

  3. #3
    Guest

    Re: newbie question about Mach-O and OpenGL/GLUT

    Thank you very much OneSadCookie...it works great!! Really appreciate the help...

    For those of you out there like me who don't really know what a framework is, this worked for me:

    In CW:
    1) select Project --> Set Default Target --> Mach-O C Console Final
    2) click on the Frameworks tab
    3) select Project --> Add files
    a) navigate to /System/Library/Frameworks
    b) just like OneSadCookie says, choose the OpenGL, GLUT, and Cocoa frameworks.
    c) de-select the checked boxes for classic and carbon when the dialog box comes up asking which targets you want to add the frameworks to

  4. #4
    Guest

    Re: newbie question about Mach-O and OpenGL/GLUT

    ...Hmm, maybe I spoke too soon:
    Somehow the GLUT left, middle, and right mouse buttons have disappeared (they don't appear in the menu bar as they do for a Carbon console). Is there a quick fix for this?

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Dec 2001
    Location
    Wellington, New Zealand
    Posts
    548

    Re: newbie question about Mach-O and OpenGL/GLUT

    Use the left, middle and right mouse buttons, respectively

    If you don't have a 3-button mouse, I believe you can use ctrl-click instead of right-click, and option-click instead of middle-click. Not entirely sure, though.

  6. #6
    Guest

    Re: newbie question about Mach-O and OpenGL/GLUT

    Sorry, I should have been more specific:
    The popup menu/submenus associated with each of the buttons don't appear (the Right, Left, and Middle buttons certainly still do work when you ctrl-click, opt-click, etc.)
    Thanks.

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Dec 2001
    Location
    Wellington, New Zealand
    Posts
    548

    Re: newbie question about Mach-O and OpenGL/GLUT

    They're working for me on 10.2.3...

  8. #8
    Guest

    Re: newbie question about Mach-O and OpenGL/GLUT

    You're right...upgrading to 10.2.3 works. Thanks.

Posting Permissions

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