* compiling with Digital C
@ 1999-07-05 4:00 ijkdc
1999-07-06 4:00 ` Kevin Oberman
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: ijkdc @ 1999-07-05 4:00 UTC (permalink / raw)
Hello,
I'm trying to compile a C program with Digital C. Unfortunately I
didn't write the program which will make it harder to debug and the
author doesn't seem to have any experience with non-GNU compilers. The
program compiles fine on my Linux box with gcc but has trouble with
Digital C on OSF/1. I get the following error:
cc: Error: icq_response.c, line 299: In this declaration, "sin" has no
linkage a
nd is of an incomplete type.
struct sockaddr_in sin; /* used to store inet addr stuff */
---------------------------^
I don't really understand the error message and I've never declared a
struct like that. I would have to agree that it's an incomplete type,
but gcc doesn't seem to mind it. Could someone shed some light on this
situation please?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: compiling with Digital C
1999-07-05 4:00 compiling with Digital C ijkdc
@ 1999-07-06 4:00 ` Kevin Oberman
1999-07-07 4:00 ` Ron Fox
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Kevin Oberman @ 1999-07-06 4:00 UTC (permalink / raw)
ijkdc@hotmail.com writes:
> Hello,
> I'm trying to compile a C program with Digital C. Unfortunately I
> didn't write the program which will make it harder to debug and the
> author doesn't seem to have any experience with non-GNU compilers. The
> program compiles fine on my Linux box with gcc but has trouble with
> Digital C on OSF/1. I get the following error:
>
> cc: Error: icq_response.c, line 299: In this declaration, "sin" has no
> linkage a
> nd is of an incomplete type.
> struct sockaddr_in sin; /* used to store inet addr stuff */
> ---------------------------^
>
> I don't really understand the error message and I've never declared a
> struct like that. I would have to agree that it's an incomplete type,
> but gcc doesn't seem to mind it. Could someone shed some light on this
> situation please?
Just general advice when compiling public code with DEC C...use the
-std option. If you don't, K&R syntax is assumed.
--
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest Orlando Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net Phone: +1 510 486-8634
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: compiling with Digital C
1999-07-05 4:00 compiling with Digital C ijkdc
1999-07-06 4:00 ` Kevin Oberman
@ 1999-07-07 4:00 ` Ron Fox
1999-07-10 4:00 ` Rob Urban
1999-07-11 4:00 ` Rob Urban
3 siblings, 0 replies; 5+ messages in thread
From: Ron Fox @ 1999-07-07 4:00 UTC (permalink / raw)
This is only an incomplete definition if there is not, somewhere a
definition of the sockaddr_in structure. That structure is part
of the BSD socket api and a def can be gotten by
#include <resolv.h>
RF
ijkdc@hotmail.com wrote:
>
> Hello,
> I'm trying to compile a C program with Digital C. Unfortunately I
> didn't write the program which will make it harder to debug and the
> author doesn't seem to have any experience with non-GNU compilers. The
> program compiles fine on my Linux box with gcc but has trouble with
> Digital C on OSF/1. I get the following error:
>
> cc: Error: icq_response.c, line 299: In this declaration, "sin" has no
> linkage a
> nd is of an incomplete type.
> struct sockaddr_in sin; /* used to store inet addr stuff */
> ---------------------------^
>
> I don't really understand the error message and I've never declared a
> struct like that. I would have to agree that it's an incomplete type,
> but gcc doesn't seem to mind it. Could someone shed some light on this
> situation please?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: compiling with Digital C
1999-07-05 4:00 compiling with Digital C ijkdc
1999-07-06 4:00 ` Kevin Oberman
1999-07-07 4:00 ` Ron Fox
@ 1999-07-10 4:00 ` Rob Urban
1999-07-11 4:00 ` Rob Urban
3 siblings, 0 replies; 5+ messages in thread
From: Rob Urban @ 1999-07-10 4:00 UTC (permalink / raw)
ijkdc@hotmail.com wrote:
>
> Hello,
> I'm trying to compile a C program with Digital C. Unfortunately I
> didn't write the program which will make it harder to debug and the
> author doesn't seem to have any experience with non-GNU compilers. The
> program compiles fine on my Linux box with gcc but has trouble with
> Digital C on OSF/1. I get the following error:
>
> cc: Error: line 299: In this declaration, "sin" has no
> linkage and is of an incomplete type.
> struct sockaddr_in sin; /* used to store inet addr stuff */
> ---------------------------^
>
> I don't really understand the error message and I've never declared a
> struct like that. I would have to agree that it's an incomplete type,
> but gcc doesn't seem to mind it. Could someone shed some light on this
> situation please?
The error message indicates that the definition of 'struct sockaddr_in' is
missing. You probably need to '#include <netinet/in.h>'.
When trying to solve such problems, there's a foolproof way of getting to
the bottom of things. Use the compiler flags
-source_listing -show all
along with regular parameters. The (pre-)compiler will write a <file>.lis
output file which you can open with an editor. Simply look for the
first occurance of the symbol in question. I suspect in this case the
first occurance will be in the source module 'icq_response.c', which means
'struct sockaddr_in' never gets defined.
cheers,
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: compiling with Digital C
1999-07-05 4:00 compiling with Digital C ijkdc
` (2 preceding siblings ...)
1999-07-10 4:00 ` Rob Urban
@ 1999-07-11 4:00 ` Rob Urban
3 siblings, 0 replies; 5+ messages in thread
From: Rob Urban @ 1999-07-11 4:00 UTC (permalink / raw)
ijkdc@hotmail.com wrote:
>
> Hello,
> I'm trying to compile a C program with Digital C. Unfortunately I
> didn't write the program which will make it harder to debug and the
> author doesn't seem to have any experience with non-GNU compilers. The
> program compiles fine on my Linux box with gcc but has trouble with
> Digital C on OSF/1. I get the following error:
>
> cc: Error: line 299: In this declaration, "sin" has no
> linkage and is of an incomplete type.
> struct sockaddr_in sin; /* used to store inet addr stuff */
> ---------------------------^
>
> I don't really understand the error message and I've never declared a
> struct like that. I would have to agree that it's an incomplete type,
> but gcc doesn't seem to mind it. Could someone shed some light on this
> situation please?
The error message indicates that the definition of 'struct sockaddr_in' is
missing. You probably need to '#include <netinet/in.h>'.
When trying to solve such problems, there's a foolproof way of getting to
the bottom of things. Use the compiler flags
-source_listing -show all
along with regular parameters. The (pre-)compiler will write a <file>.lis
output file which you can open with an editor. Simply look for the
first occurance of the symbol in question. I suspect in this case the
first occurance will be in the source module 'icq_response.c', which means
'struct sockaddr_in' never gets defined.
cheers,
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-07-11 4:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-07-05 4:00 compiling with Digital C ijkdc
1999-07-06 4:00 ` Kevin Oberman
1999-07-07 4:00 ` Ron Fox
1999-07-10 4:00 ` Rob Urban
1999-07-11 4:00 ` Rob Urban
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox