 |
 |
10.1 OpenGL/GLUT no longer compiles
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Oct 2001
Location: Vancouver
Status:
Offline
|
|
Hi everyone,
I have been using Project Builder in 10.0.4 for some simple academic OpenGL work. After upgrading to 10.1 my projects no longer compile. I think something is messing up during linking, and I suspect that this is related to 10.1's new namespace problems. Here is an example of the errors I get using some bare-bones OpengGL/GLUT code:
Linking /Users/colin/3DTest/build/3DTest.app/Contents/MacOS/3DTest (1 error, 1 warning)
warning -F: directory name (/Users/colin/3DTest/build/ProjectHeaders) does not exist
/Users/colin/3DTest/build/3DTest.build/master.o illegal reference to symbol: _glClear defined in indirectly referenced dynamic library /System/Library/Frameworks/
I have been using PB's "Cocoa Application" project type and have been including the library <GLUT/glut.h>.
Does anyone know how to get this working?
Thank-you.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Dec 2000
Location: Berkeley, CA
Status:
Offline
|
|
I've run into the exact same issues with my new and old projects. Notice however that the example GLUT projects compile fine.
I've changed the various frameworks and even started from scratch. Anybody have a solution?
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Dec 2000
Location: Berkeley, CA
Status:
Offline
|
|
This is discussed in the Project Builder 10.1 Release Notes.
The solution is simple:
You must add an additional flag for the linker, so that it links the libraries properly. So, under your selected Targer's build settings, add the flag -flat_namespace under the Other Linker Flags heading. Clean and rebuild your project and it should link fine.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: May 2001
Status:
Offline
|
|
Originally posted by Xool:
<STRONG>I've run into the exact same issues with my new and old projects. Notice however that the example GLUT projects compile fine.
I've changed the various frameworks and even started from scratch. Anybody have a solution?</STRONG>
You need to add the GLUT *and* OpenGL Frameworks to your projects, then the syntax for the GLUT includes is:
#include <GLUT/glut.h>
and all the remaining includes are standard OGL style:
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
That ought to get GLUT working for you again. If you need access to the C++ libraries, either start with a C++ Tool project and add those two above frameworks, or start with a Cocoa project and add the Kernel Framework in addition to the two above frameworks.
-Nathan
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Dec 2000
Location: Berkeley, CA
Status:
Offline
|
|
Obviously the Framework needs to be added to the project along with the necessary include statements... However, the GLUT framework should already link to the OpenGL framework, so there's no need to include both. (Correct me if I'm wrong.)
However, my problem was compiling my GLUT based application in 10.1. It worked fine in 10.0.x. My solution with the flat namespace flag (or whatever) fixed all my problems. It would compile fine but fail on linking... now its fine!
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |