Help with <GL/glut.h> please.

DudetheCreator
Unregistered
 
Post: #16
ARGH! I tried with a cocoa target and got a error where gl_matrix and gl_color, i think it was them, were unknown symbols...
Mad
Quote this message in a reply
Vertizor
Unregistered
 
Post: #17
Did you bring in OpenGL.framework?
Quote this message in a reply
Member
Posts: 257
Joined: 2004.06
Post: #18
DudetheCreator Wrote:Ah-Ha! So the tutorial is wrong? And I should add a cocoa target?

Uh, I'm pretty sure it isn't since I've followed it a couple times and have made a GLUT/Carbon based app just fine...

The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Quote this message in a reply
DudetheCreator
Unregistered
 
Post: #19
Yes, but I'm not using the source code from the tutorial! I'm using the source code from the Guide to OpenGL Programming! I know, I will blend them! And it WILL WORK!
Quote this message in a reply
DudetheCreator
Unregistered
 
Post: #20
Right, I have followed the tutorial, but used code I got from the OpenGL book. I get 3766 errors. Is that a record? All the errors are in header files, in framworks, like foundation.framework and cocoa.framework. I think I will start from scratch using my very basic knowledge of OpenGL and make MY OWN code according to te book AND the tutorial.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #21
There is a bug in Xcode where main.c or main.cpp in a Cocoa project will give you vast numbers of errors. This is why you make a Carbon app; not because you really want Carbon.

If you follow the tutorial, then replace the tutorial code with your own, everything should work.
Quote this message in a reply
DudetheCreator
Unregistered
 
Post: #22
HeHe, I think I'll learn Basic First.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #23
That's not a bug. It is invalid to #include a header using Obj-C from C.

You might as well try importing FORTRAN from perl.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #24
Try it - you don't have to import any ObjC headers for it to cause vast numbers of errors.

I thought it had been fixed in Xcode 1.5, but maybe not.
Quote this message in a reply
DudetheCreator
Unregistered
 
Post: #25
Ay, errors. Evil minions of doom. Sad
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #26
Works fine here in Xcode 1.5:

1) new Cocoa Application
2) delete main.m
3) replace it with this main.c:
Code:
#include <stdio.h>

int main(int argc, char *argv[]) {
    printf("HELLO SAILOR\n");
    return 0;
}
4) build & run

Result:
0 warnings, 0 errors, "HELLO SAILOR" in the console.

What's the problem?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #27
well, it didn't work when I wrote the tutorial, and clearly still doesn't work for some people here Wink
Quote this message in a reply
Post Reply