View Full Version : 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:
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...
01-15-2003, 11:19 AM
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.
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:
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
...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?
01-15-2003, 04:53 PM
Use the left, middle and right mouse buttons, respectively http://www.opengl.org/discussion_boards/ubb/wink.gif
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.
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.)
01-16-2003, 11:04 AM
They're working for me on 10.2.3...
You're right...upgrading to 10.2.3 works. Thanks.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.