B
Bill Cunningham
I received this error and can't figure it out so I thought I would post
it. This has to do with posix and I guess it would fit under standard C.
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
struct addrinfo sin, *psin;
int pass(void)
{
sin.ai_family = PF_INET;
sin.ai_socktype = SOCK_STREAM;
sin.ai_protocol = 0;
sin.ai_flags = AF_PASSIVE;
}
pass.c:6: warning: built-in function 'sin' declared as non-function
pass.c: In function `pass':
pass.c:13: error: `AF_PASSIVE' undeclared (first use in this function)
pass.c:13: error: (Each undeclared identifier is reported only once
pass.c:13: error: for each function it appears in.)
It looks to me like some macros are out of scope. I'm using the headers
I am supposed to. I believe I am following directions properly. As per this
site where I'm learning but writing my own code.
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html
Bill
it. This has to do with posix and I guess it would fit under standard C.
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
struct addrinfo sin, *psin;
int pass(void)
{
sin.ai_family = PF_INET;
sin.ai_socktype = SOCK_STREAM;
sin.ai_protocol = 0;
sin.ai_flags = AF_PASSIVE;
}
pass.c:6: warning: built-in function 'sin' declared as non-function
pass.c: In function `pass':
pass.c:13: error: `AF_PASSIVE' undeclared (first use in this function)
pass.c:13: error: (Each undeclared identifier is reported only once
pass.c:13: error: for each function it appears in.)
It looks to me like some macros are out of scope. I'm using the headers
I am supposed to. I believe I am following directions properly. As per this
site where I'm learning but writing my own code.
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html
Bill