-
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...
-
Advanced Member
Frequent Contributor
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.
-
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
-
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?
-
Advanced Member
Frequent Contributor
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.
-
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.
-
Advanced Member
Frequent Contributor
Re: newbie question about Mach-O and OpenGL/GLUT
They're working for me on 10.2.3...
-
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
-
Forum Rules