Hi All,
I am trying to use xcode to compile something that I got running through gcc in terminal. I hit a snag with some structs I am using. It seems simple enough, but I still keep getting errors. Anyways, I've defined the struct 'Point' in the following way:
Now when I try to use this struct in the following code:
I get the errors:
I'm pretty sure I haven't setup my compiler correctly since I can compile this code from terminal using gcc. Does anyone have any suggestions why this wouldn't work in xcode and how I might be able to fix it?
Cheers,
ScKaSx
I am trying to use xcode to compile something that I got running through gcc in terminal. I hit a snag with some structs I am using. It seems simple enough, but I still keep getting errors. Anyways, I've defined the struct 'Point' in the following way:
#define dVec Vector<double>
struct Point {
dVec xy;
Point *next;
};
Now when I try to use this struct in the following code:
inline Point *new_Points(Contour_Points *cp)
{
Point *head= new Point;
Point *point= head;
point->xy=cp->xy;
while (NULL!=(cp=cp->next)) {
point=(point->next= new Point);
point->xy=cp->xy;
}
point->next=NULL;
return head;
}
I get the errors:
error:'struct Point' has no member named 'xy'
error:'struct Point' has no member named 'next'
I'm pretty sure I haven't setup my compiler correctly since I can compile this code from terminal using gcc. Does anyone have any suggestions why this wouldn't work in xcode and how I might be able to fix it?
Cheers,
ScKaSx