gcc in Mac OS X

I am unable to compile any C++ programs with OpenGL libs.
The headers are found, but the compiler reports that the functions have not been declared.

Is there any way to compile OpenGL programs without using Project Builder?

Project Builder just uses GCC underneath, so yes

You have to know a little about the Mac OS X-specific bits, though.

If you’re using GLUT, you need these linker flags:

-framework OpenGL -framework GLUT -lobjc

This replaces the X11/g++ flags -lGL -lGLU -lglut -lX11 …

If you’re using SDL:

-framework OpenGL -framework SDL -framework Cocoa

Depending on where your SDL framework is, you may also need to use the -F flag (like -I or -L) to tell the compiler where to find it. You may also need to ensure the framework gets copied into your application’s bundle.

If you’re using AGL/Carbon, you’ll need these:

-framework OpenGL -framework AGL -framework Carbon

And for Cocoa/NSGL:

-framework OpenGL -framework Cocoa

HTH

[This message has been edited by OneSadCookie (edited 06-02-2003).]

xy.cpp:144: flDrawString' undeclared (first use this function) xy.cpp: In functionvoid myinit()’:
xy.cpp:200: charset' undeclared (first use this function) xy.cpp:200: parse error before(’ token
xy.cpp:209: flSetWidth' undeclared (first use this function) xy.cpp:210:flSetHeight’ undeclared (first use this function)
xy.cpp:216: texture' undeclared (first use this function) xy.cpp:216: parse error before(’ token

That’s a compile error, not a link error. It’s also not an OpenGL error. Go to the fl forums, whatever fl is.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.