Re: Illegal declaration - but why?
Re: Illegal declaration - but why?
- Subject: Re: Illegal declaration - but why?
- From: Hugh Brown <email@hidden>
- Date: Wed, 3 Jan 2007 20:39:14 -0800
I tried this and did not see any errors. However, I did notice something that indicates it may be related to he bool keyword - which is almost too weird to consider, but here goes anyway:
Just about every function in this program returns a bool, and I get the error messages I listed before. Looking over the whole list of errors I realized that if a function also takes a bool as an argument, I get two error messages. For example, the function
bool writeSettings(char *path, char *errString, bool force);
gets these errors (one more than the first example):
<x-tad-smaller>error: parse error before "writeSettings"
</x-tad-smaller> <x-tad-smaller>error: parse error before "bool"
data definition has no type or storage class
</x-tad-smaller>Further, if I change he return type of the first example from bool to int, so there are no bools at all in the declaration, the error message goes away.
I suppose I can change all bools to ints in the whole program, but that would be tedious and should not be neccessary. It's not like xcode does not recognize bool as a keyword - it marks it up in the same color it uses for char or int.
Does anyone know what xcode has against bools?
Thanks,
Hugh
On Jan 3, 2007, at 8:14 PM, alex wrote:
sorry I meant preprocess the file.
a
At 8:11 PM -0800 1/3/07, alex wrote:
I would try precompiling the source file to see if all the types that 'bool SetConfigs(char *errString)' uses are defined.
alex
At 8:08 PM -0800 1/3/07, Hugh Brown wrote:
I'm new to xcode, and have just ben handed a project to port to the mac. It's a plain vanilla C program, but when I try to compile it I get a string of errors complaining about the headers. A typical error message is:
error: parse error before "SetConfigs"
data definition has no type or storage class
The declaration of SetConfigs looks like
bool SetConfigs(char *errString);
which looks pretty legit to me. I get this pair of error messages for every function declaration in the project. Obviously, I'm doing something fundamentally wrong, but I can't see what. Isthere something particular to xcode that prevents this from compiling?
Is there an on-line reference somewhere that will answer basic questions like this so I don't pester the list with them?
Thanks!
Hugh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden