Xcode build issue

Nibbie
Posts: 3
Joined: 2009.09
Post: #1
I am attempting to get a start in game programming. I am currently planning out a progression path and ensuring I have the tools required to learn continuously.

I am now attempting to get OpenGL working. I have followed a guide for using OpenGL in Xcode and using some example code I have been able to build an app. However, the app does not fully launch. Xcode returns:

Quote:XcodeGLUT has exited with status 5.

The console shows this:
Quote:[Session started at 2009-09-02 18:51:04 -0400.]
2009-09-02 18:51:04.592 Xcode[469:203] *** NSTask: Task create for path '/Users/job1984/Desktop/Xcodeglut/build/Debug/XcodeGLUT.app' failed: 13, "Permission denied". Terminating temporary process.

The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP).

Here is the contents of main.c:
Code:
#include <stdlib.h>
#include <OpenGL.h>
#include <GLUT/glut.h>

void display(void)
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    
    glutSwapBuffers();
}

void reshape(int width, int height)
{
    glViewport(0, 0, width, height);
}

void idle(void)
{
    glutPostRedisplay();
}

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    
    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
    glutInitWindowSize(640, 480);
    
    glutCreateWindow("GLUT Program");
    
    glutDisplayFunc(display);
    glutReshapeFunc(reshape);
    glutIdleFunc(idle);
    
    glutMainLoop();
    return EXIT_SUCCESS;
}
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #2
Weird. I wonder how you could wind up with a permission denied?

Anyway, the code looks fine except for the line:

#include <OpenGL.h>

Which would need to be

#include <OpenGL/OpenGL.h>

But that would yield a compiler error first before you even built it, not a permission denied.

Have you tried OneSadCookie's GLUT tutorial? Definitely worth a look.
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2009.09
Post: #3
That is the tutorial I followed. As I said, everything works out fine, aside from the permission error, and the app returning 5. I have checked my permissions for the directory in question and I have full read/write permissions. I am logged in as admin so I am not sure why I am getting a permission denied.

Any ideas on a way around this?

Thanks,

Drew
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #4
I'm stumped...

Presumably the task is the program trying to be launched by Xcode and it's being blocked from doing so. Don't know why though...

Did you fiddle with the target settings at all? Change the name of the app?

Can you double-click XcodeGLUT from the Finder and does it launch like that?

Is the project corrupt? Can you try doing the tutorial again from scratch?
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2009.09
Post: #5
It must have been a corruption issue. I redid the tutorial, worked like a charm.

Before redoing the tutorial I did notice the .app file was unlaunchable from the finder. The .app was not recognized as compatible with my computer's architecture. I am guessing, as you said, something must have been corrupt or perhaps I missed/added something I should not have.

Thanks very much for you help, now I am all set to start learning OpenGL.

-Drew
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  new xcode project missing build settings kendric 3 3,141 Nov 18, 2009 07:11 PM
Last Post: kendric
  xcode memory error thing issue NelsonMandella 1 2,962 Feb 22, 2009 10:41 PM
Last Post: AnotherJake