Re: A quick socket question
joe_at_invalid.address
Date: 09/27/03
- Next message: Darko M.: "Re: Got stuck with redirecting to less"
- Previous message: captainblak2000_at_yahoo.com: "A quick socket question"
- In reply to: captainblak2000_at_yahoo.com: "A quick socket question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 27 Sep 2003 15:46:55 GMT
captainblak2000@yahoo.com writes:
[followup to comp.lang.c not honored, they'll just tell you to go
away]
> I am new to socket programming and have this declaration here.
>
> #include <sys/socket.h>
> #include <sys/types.h>
> #include <string.h>
>
> #define DEST_IP "192.168.0.3"
> #define DEST_PORT 23
>
> int main (void)
> {
> struct sockaddr_in dest_addr;
> ...
> }
>
> when i compile with gcc i get
> socktest.c: In function `main':
> socktest.c:10: storage size of `dest_addr' isn't known
>
> what is the problem and how do i solve it?
The problem is that you didn't include the header file that declares
struct sockaddr_in, which is <netinet/in.h>. The solution is to
include it.
When the compiler tells you that something is of unknown size, or is
an icomplete type, that's usually what happened.
Joe
- Next message: Darko M.: "Re: Got stuck with redirecting to less"
- Previous message: captainblak2000_at_yahoo.com: "A quick socket question"
- In reply to: captainblak2000_at_yahoo.com: "A quick socket question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|