On Mon, Apr 21, 2008 at 10:07:20PM -0700, Chris Kuethe wrote: > On Mon, Apr 21, 2008 at 9:44 PM, vatocleti <[EMAIL PROTECTED]> wrote: > > > > Hey all, > > Sorry for the 'stuipid' question, but I'm new to Linux/BSD. I inherited a > > program from a coleague and have to port it over from Linux to BSD. I do a > > 'make' and it fails with errors stating..."undefined variable, first > > declare"....basically errors stating that something is undefined, seems it > > does it for every parameter that's defined in the *.c file. > > last few times i saw this it was slightly compiler related: gcc3 > doesn't like variable declarations after executable statements. i > moved the variable declarations to the top of the block and the > problem went away. also, it could be that the variable is > conditionally declared based on something in the headers and your > compilation environment is different enough that the declaration isn't > being processed.
You're confused. gcc3 likes this just fine, it's gcc 2.95 that doesn't like C99-style decls. Since we still have arches running gcc 2.95, we tend to avoid these. ;-)