Hi all,
I am trying to include a C header into a C++ program. In this header, I have the following:
1 | typedef struct |
2 | { |
3 | //char ident[4]; |
4 | int ident; |
5 | int version; |
6 | int skin_width; /* ignored - this is filled later when loading the texmap */ |
7 | int skin_height; /* ignored - this is filled later when loading the texmap */ |
8 | int frame_size; |
9 | int num_skins; /* ignored */ |
10 | int num_vertices; |
11 | int num_texture_coords; |
12 | int num_triangles; |
13 | int num_gl_commands; |
14 | int num_frames; |
15 | int offset_skins; /* ignored */ |
16 | int offset_texture_coords; |
17 | int offset_triangles; |
18 | int offset_frames; |
19 | int offset_gl_commands; |
20 | int offset_end; |
21 | } MD2_HEADER_STRUCT; |
When I compile, I get:
md2_model.h:31: error: two or more data types in declaration of 'MD2_HEADER_STRUCT'
...and wrapping the include up in extern "C" { didn't fix it. Has anyone seen this before and knows what it might be?
Posted here because it's not really allegro-related.
it's programming related, isnt there a programming sub forum?
There appears to be nothing wrong with the code you posted. I compiled it fine as C code. Google searches suggest that a function (or something) is declared with 2 data types... For example...
int char func(void); // More than one data type.
I guess make sure you're giving us the offending code and/or look for a declaration with two data types.
Which line is line 31?
My guess is a missing ; or } above it.