PDA

View Full Version : Basic typedef'd struct inclusion problem




99miles
Feb 25, 2009, 08:06 PM
I have a typedef'd struct I want to use in multiple files:

typedef struct point {
int col;
int row;
} point;

When I include it in a header file that is included by multiple files, I get:
"SomeFile.h:18: fatal error: method definition not in @implementation context" where another .h file defines a method with that type:
-(CGRect)createObj: (point)p;

What am I doing wrong?
Thanks!



99miles
Feb 25, 2009, 08:20 PM
Oops, I got it. I was including the class file, not the header of the file that defined the struct.