Parsing error!?

A

ArmedCoder

Ok, i have this problem that is driving me nuts!

I have a header file that has the function definition:
landindp get_world_landind( worldp world );
where landindp and worldp are pointers to structs.
I keep getting errors saying "parse error before get_world_landind()"
and "warning: data definition has no type or storage class"

Now i have the landind.h file included, and landindp is defined as:
typedef struct landind *landindp;

and in landind.c
struct landind
{
//insert code here
} landind_;

Any ideas why i would be getting this error? It seems to me that the
struct is not being seen, but why?
 
M

Mike Wahler

ArmedCoder said:
Ok, i have this problem that is driving me nuts!

I have a header file that has the function definition:
landindp get_world_landind( worldp world );
where landindp and worldp are pointers to structs.
I keep getting errors saying "parse error before get_world_landind()"
and "warning: data definition has no type or storage class"

Now i have the landind.h file included, and landindp is defined as:
typedef struct landind *landindp;

and in landind.c
struct landind
{
//insert code here
} landind_;

Any ideas why i would be getting this error? It seems to me that the
struct is not being seen, but why?

Put together a small complete example program that
demonstrates this error. Also show the contents
of the #included header. Don't type it in, copy
and paste it into your message.

-Mike
 
B

Ben Pfaff

I have a header file that has the function definition:
landindp get_world_landind( worldp world );
where landindp and worldp are pointers to structs.
I keep getting errors saying "parse error before get_world_landind()"
and "warning: data definition has no type or storage class"

Make sure that the declaration before that one is properly
terminated with ; or }. If that doesn't help, try running the
file through a C preprocessor to see if a macro is expanding
unexpectedly somewhere.

Is worldp properly declared?
 
I

Ian Tuomi

ArmedCoder said:
I keep getting errors saying "parse error before get_world_landind()"
and "warning: data definition has no type or storage class"

I get similar errors when forgetting to close brackets.
You should try going through the code before the error and see if you
forgot any.

--
Ian Tuomi
Jyväskylä, Finland

"Very funny scotty, now beam down my clothes."

GCS d- s+: a--- C++>$ L+>+++$ E- W+ N+ !o>+ w---
!O- !M- t+ !5 !X R+ tv- b++ DI+ !D G e->+++ h!

NOTE: Remove NOSPAM from address
 
P

Peter Shaggy Haywood

Groovy hepcat ArmedCoder was jivin' on 2 Oct 2003 22:08:15 -0700 in
comp.lang.c.
Parsing error!?'s a cool scene! Dig it!
I have a header file that has the function definition:
landindp get_world_landind( worldp world );
where landindp and worldp are pointers to structs.
I keep getting errors saying "parse error before get_world_landind()"
and "warning: data definition has no type or storage class"

Now i have the landind.h file included, and landindp is defined as:
typedef struct landind *landindp;

and in landind.c
struct landind
{
//insert code here
} landind_;

Any ideas why i would be getting this error? It seems to me that the
struct is not being seen, but why?

Others have given some suggestions, but this may help if they don't.
I've seen weird things like this if the last line of an included
header is not properly newline-terminated. Make sure each header ends
in a newline.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top