What does this error mean?

R

Richard Bos

packet.h:55: two or more data types in declaration of `construct_request'
packet.h:55: long, short, signed or unsigned invalid for `construct_request'
Here is what line 55 in packet.h is:

unsigned char *construct_request(unsigned char *packet);

Wild guess time, since you haven't shown enough code for a tame guess.

You may have #defined or typedef'd construct_request to be a type. For
example, you could have done

#define construct_request int

or

typedef int construct_request;

earlier in your code.

If not, post more code.

Richard
 
Z

Zero

cc -c -o member.o member.c
In file included from member.c:3:
packet.h:55: two or more data types in declaration of `construct_request'
packet.h:55: long, short, signed or unsigned invalid for `construct_request'
make: *** [member.o] Error 1


Here is what line 55 in packet.h is:

unsigned char *construct_request(unsigned char *packet);

Why do I get this error when compiling the program?
 
R

Ronald Landheer-Cieslak

cc -c -o member.o member.c
In file included from member.c:3:
packet.h:55: two or more data types in declaration of `construct_request'
packet.h:55: long, short, signed or unsigned invalid for `construct_request'
make: *** [member.o] Error 1


Here is what line 55 in packet.h is:

unsigned char *construct_request(unsigned char *packet);

Why do I get this error when compiling the program?
It look suspiciously as if your compiler doesn't support unsigned char. I have
no idea as to what kind of compiler wouldn't like that, though..

Another idea that comes to mind is that your compiler might not like the way
you wrote your prototype - i.e. it might not like "packet" and mistakenly
croak on something else (i.e. it might want K&R style prototypes).

Anyways, I don't see any actual problem on this one line.. there's no macro
name here anywhere, I suppose? (construct_request and packet are not macros)?

oddness is staring at me.. ;)

rlc


--
Jail: Just Another Interpreted Language
Just: Jail Uses Silly Terms

Join the discussion on the definition of this language at
(e-mail address removed) http://jail-ust.sourceforge.net
(send mail to (e-mail address removed))
 
A

Allan Bruce

Zero said:
cc -c -o member.o member.c
In file included from member.c:3:
packet.h:55: two or more data types in declaration of `construct_request'
packet.h:55: long, short, signed or unsigned invalid for `construct_request'
make: *** [member.o] Error 1


Here is what line 55 in packet.h is:

unsigned char *construct_request(unsigned char *packet);

Why do I get this error when compiling the program?

It looks as though the error may be elsewhere, try posting a bit more of
your code
Allan
 
D

Dan Pop

In said:
cc -c -o member.o member.c
In file included from member.c:3:
packet.h:55: two or more data types in declaration of `construct_request'
packet.h:55: long, short, signed or unsigned invalid for `construct_request'
make: *** [member.o] Error 1


Here is what line 55 in packet.h is:

unsigned char *construct_request(unsigned char *packet);

Why do I get this error when compiling the program?

Most likely, because you're trying to compile a standard C program with
a K&R C compiler.

Read cc's man page to see if it can be invoked in standard C mode or use
gcc to compile the code.

Dan
 
D

Darrell Grainger

cc -c -o member.o member.c
In file included from member.c:3:
packet.h:55: two or more data types in declaration of `construct_request'
packet.h:55: long, short, signed or unsigned invalid for `construct_request'
make: *** [member.o] Error 1

In member.c on line 3 is the statement #include "packet.h". In the file
packet.h the compiler encountered a problem on OR BEFORE line 55. It
thinks the problem is two or more data types in declaration of
'construct_request' are invalid.

The key things to remember are that the problem could have occurred on
line 1 or 2 of member.c or on lines 1 through 55 of packet.h.
Here is what line 55 in packet.h is:

unsigned char *construct_request(unsigned char *packet);

Why do I get this error when compiling the program?

I see nothing wrong with this line. Must be before line 55. First thinkg
I'd check for is a missing semicolon on line 54.

--
darrell at cs dot toronto dot edu
or
main(){int j=1234;char t[]=":mad:abcdefghijklmnopqrstuvwxyz.\n",*i=
"iqgbgxmdbjlgdv.lksrqek.n";char *strchr(const char *,int);while(
*i){j+=strchr(t,*i++)-t;j%=sizeof t-1;putchar(t[j]);} return 0;}
 
B

Ben Pfaff

cc -c -o member.o member.c
In file included from member.c:3:
packet.h:55: two or more data types in declaration of `construct_request'
packet.h:55: long, short, signed or unsigned invalid for `construct_request'
make: *** [member.o] Error 1

I would check the code just before this, to make sure that the
previous declaration was properly terminated with a ; or }.
 
Z

Zero

Thanks for your replies.

It turned out that I for got a semi-colon on the line above.

Oooppps!
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top