-Brandon
> Under OS X - using ProjectBuilder - I'm trying to compile a simple
> OpenGL program that uses GLUT but I keep getting errors about PB not
> being able to find gl.h, glu.h, and glut.h. Like the NeHe tutorial
> says, I used the Cocoa application stationary and added both the OpenGL
> and GLUT frameworks to the project. How should my #inludes look?
> Should I use 'GL/' before the file names? should I use quation marks
<snip>
Change <GL/ to <OpenGL/ in your #includes.
--
Kevin Reid
In article <em-F86AAD.20...@netnews.attbi.com>, Brandon
<e...@il.com> wrote:
Use <OpenGL/ header> for the OpenGL framweork, and use <GLUT/glut.h>
for the GLUT framework. The GLUT framwork references the OpenGL
framework, so that's the only one you need for GLUT apps.
It doesn't matter whether it's CW or PB - the framework includes are
the same. You have to add the fraweworks to the project in either
environment as well.
First, the headers are in different places:
ifdef MAC_OS_X
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#indlude <GLUT/glut.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#endif
you also need to include the frameworks in your project. Look in the
project menu under "Add Framework". Finaly, if you're writing a
carbon app, you will need to add the objective-C libraries... the
implimentation of GLUT in OS X uses Cocoa, so you need to add libobjc
or you'll get link errors.
Thanks BBob... this is exactly where i was stuck.
A question on Carbon and C++... does the objective c libs allow c++
object oriented code to work in a Carbon app???
I wanna port over some C++ code, but not go over to Cocoa.
Thanks
--Mike
Yes. Including the ObjC runtime system in a C++ app no matter whether it
uses Carbon, straight Core, BSD or whatever, has no negative consequences on
the C++ part.
Regards,
Dietmar Planitzer
> A question on Carbon and C++... does the objective c libs allow c++
> object oriented code to work in a Carbon app???
Objective C != C++
You shouldn't try to use Carbon and Cocoa together.
> I wanna port over some C++ code, but not go over to Cocoa.
You can simply call Carbon APIs from C++ code.
Cheers,
M. Uli Kusterer
"The Witnesses of TeachText are everywhere..."
> In article <1d523460.02050...@posting.google.com>,
> mike...@att.net (Mike Hense) wrote:
>
> > A question on Carbon and C++... does the objective c libs allow c++
> > object oriented code to work in a Carbon app???
I should add to my previous terse comment: There's nothing keeping you
from using C++ code in a Cocoa app, but you might have to put that in
Objective C++ source files (.M or .mm suffix) so you'll be able to mix
C++ and ObjC calls.
I've heard from people in this NG who successfully mixed Carbon and
Cocoa in an application, but I've also heard from someone at Apple that
you're not supposed to do that.
However, IIRC Only GLUT relies on Cocoa while the OpenGL library itself
doesn't, which means you might be able to use pure OpenGL in a Carbon
app. But I never tried myself.