Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Miglu

macrumors member
Original poster
Jan 22, 2010
74
0
I have a C file in a project and when I build I get these errors in it:
"Unknown type name 'bool'"
"Use of undeclared identifier 'NULL'"
"Variable has incomplete type 'void'"

What is the problem?
 
I have a C file in a project and when I build I get these errors in it:
"Unknown type name 'bool'"
"Use of undeclared identifier 'NULL'"
"Variable has incomplete type 'void'"

What is the problem?

Missing include files.
 
Thanks. I solved the first and second by including stdbool and stddef. How to remove the third one? Including stdlib does not work.
Code:
void APIENTRY TessErrorCallback(GLenum errorCode)
{
	__tess_err = gluErrorString(errorCode);
}
"expected ';' after top level declarator"
"variable has incomplete type 'void'"
 
Last edited:
Code:
void APIENTRY TessErrorCallback(GLenum errorCode)
{
	__tess_err = gluErrorString(errorCode);
}
"expected ';' after top level declarator"
"variable has incomplete type 'void'"

Exactly which line or lines do the error messages refer to?

Post the code that comes before this function.

Post the complete declaration for __tess_err (its type and storage class, extern or static; are any macros or other typedefs involved?).

Is gluErrorString() declared or not?
 
I noticed that actually the void error occurs on all of the void functions in the file, not just that one. It occurs in the part that is before { (what is that part called?).
The functions have different arguments.
 
The problem was that the functions had the word APIENTRY, which is only used in Windows. It was there because I did not write the code.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.