Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ - my personal debugging army

Name: Anonymous 2008-03-30 19:30

Okay /prog/, here's something I can't work out:

squares.c:33: error: request for member 'x' in something not a structure or union
squares.c:34: error: request for member 'y' in something not a structure or union
squares.c:35: error: request for member 'z' in something not a structure or union


File squares.c, lines 32-36:
void moveSquare (Square * sqr, Vector * npos) {
        sqr->pos.x += npos.x;
        sqr->pos.y += npos.y;
        sqr->pos.z += npos.z;
}


squares.h:
typedef struct {
        Vertex verts[4];
        Vector pos, rot;
} Square;


Vector:
typedef ScePspFVector3 Vector;

And finally, in the #include <...> path:
typedef struct ScePspFVector3 {
        float   x;
        float   y;
        float   z;
} ScePspFVector3;


I'm completely stumped. Everything's in the right order. That's the only error I'm getting (so far). Is there some fundamental C convention that Google isn't telling me about? Help me [cpoiler]/prog/[/spoiler], you're my only hope.

Name: Anonymous 2008-03-30 20:15

>>1
npos is a pointer, . requires a struct or a union.
Do npos->x

Damn I feel sorry for you. I know how annoying bugs like this can be. Regardless you're a fag.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List