I am trying to create a structure used in two .c source files to create a simple structure of linked lists. I thought this would save time for creating the structure in the header file, however I get the error "parse error before *".
This is the code I'm using:
/* * Structures.h * * Created on: Dec 17, 2011 * Author: timgreene */ #ifndef STRUCTURES_H_ #define STRUCTURES_H_ typedef struct list_struct { int data; struct list_struct* next; struct list_struct* prev; } list; #endif /* STRUCTURES_H_ */
Edit: I initially omitted the details that are, I actually compile with xcc from the XMOS toolchain. I still don't understand that there will be a difference in the .h syntax.
Could this be the compilation flag I'm using?
Here's a printout of the console:
xcc -O0 -g -Wall -c -MMD -MP -MF"filter.d" -MT"filter.d filter.o " -target=XC-1A -o filter.o "../filter.xc" In file included from ../filter.xc:15: Structures.h:13: error: parse error before '*' token Structures.h:14: error: parse error before '*' token Structures.h:15: error: parse error before '}' token
c header
Tim greene
source share