Skip to main content
gamedev.net
🔒 Locked

incomplete type

Started by gasto 2 replies 700+ views
Original Post
gasto
gasto
How can I get that a structure typed parameter of a function definition is an incomplete type(As described by the error message from GCC)even when I have provided the corresponding #include of the header containing the definition of the structure type?
Intel Core 2 Quad CPU Q6600, 2.4 GHz. 3GB RAM. ATI Radeon HD 3400.
rip-off
rip-off
You might end up with a circular include, which means that by the time the code is pre-processed that the type definition comes after the function declaration or in some cases implementation.

This is often caused by so called "global" or "master" headers, which include lots of your own headers.


Read this article.
gasto
gasto
I used the:

#ifndef HELLO_H
#define HELLO_H
...
#endif // HELLO_H


magic, so I don´t think that´s the case.
Intel Core 2 Quad CPU Q6600, 2.4 GHz. 3GB RAM. ATI Radeon HD 3400.
SiCrane
SiCrane
Include guards prevent multiple definition errors, but do not guarantee that circular inclusions will work properly. Again, read the article rip-off posted.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.