Hello all, new member here!
I have enough experience with C to make myself feel like a jackass for this, but here's the issue: I'm trying to compile the sample located in net/simple in the PSPSDK 'samples' directory. Note that whenever code references the actual sdk headers (pspkernel.h, pspdebug.h), these includes work and the EBOOT is properly compiled.
However, when I try compiling network sample code that includes 'netinet/in.h', or anything that's located in /usr/include by default, I get frustrating errors that I'm sure are due to a missing setting in cygwin. Can anyone lend a hand?
Note: When I manually add /usr/include as an INCDIR in the Makefile, I still get errors, as if the constants/functions referenced aren't actually in the headers (but no 'no such file' errors, arrr matey!):
---- (Without 'INCDIR = /usr/include') -----------------------------
$ make
psp-gcc -I. -IC:/cygwin/usr/local/pspdev/psp/sdk/include -O0 -G0 -Wall -g -c -
o main.o main.c
main.c:24:24: error: netinet/in.h: No such file or directory
main.c:25:23: error: arpa/inet.h: No such file or directory
main.c:26:24: error: sys/select.h: No such file or directory
main.c:72: error: syntax error before 'port'
main.c: In function 'make_socket':
main.c:76: error: storage size of 'name' isn't known
main.c:78: warning: implicit declaration of function 'socket'
main.c:78: error: 'PF_INET' undeclared (first use in this function)
main.c:78: error: (Each undeclared identifier is reported only once
main.c:78: error: for each function it appears in.)
main.c:78: error: 'SOCK_STREAM' undeclared (first use in this function)
main.c:84: error: 'AF_INET' undeclared (first use in this function)
main.c:85: warning: implicit declaration of function 'htons'
main.c:85: error: 'port' undeclared (first use in this function)
main.c:86: warning: implicit declaration of function 'htonl'
main.c:86: error: 'INADDR_ANY' undeclared (first use in this function)
main.c:87: warning: implicit declaration of function 'bind'
main.c:76: warning: unused variable 'name'
main.c: In function 'start_server':
main.c:102: error: storage size of 'client' isn't known
main.c:117: warning: implicit declaration of function 'listen'
main.c:134: warning: implicit declaration of function 'select'
main.c:147: error: 'SOCKET_FD_PAT' undeclared (first use in this function)
main.c:150: warning: implicit declaration of function 'accept'
main.c:159: warning: implicit declaration of function 'inet_ntoa'
main.c:160: warning: implicit declaration of function 'ntohs'
main.c:160: warning: format '%s' expects type 'char *', but argument 3 has type
'int'
main.c:102: warning: unused variable 'client'
make: *** [main.o] Error 1
---- (With 'INCDIR = /usr/include') -----------------------------
$ make
psp-gcc -I/usr/include/ -I. -IC:/cygwin/usr/local/pspdev/psp/sdk/include -O0 -G0
-Wall -g -c -o main.o main.c
main.c: In function 'make_socket':
main.c:78: warning: implicit declaration of function 'socket'
main.c:78: error: 'PF_INET' undeclared (first use in this function)
main.c:78: error: (Each undeclared identifier is reported only once
main.c:78: error: for each function it appears in.)
main.c:78: error: 'SOCK_STREAM' undeclared (first use in this function)
main.c:84: error: 'AF_INET' undeclared (first use in this function)
main.c:87: warning: implicit declaration of function 'bind'
main.c: In function 'start_server':
main.c:117: warning: implicit declaration of function 'listen'
main.c:147: error: 'SOCKET_FD_PAT' undeclared (first use in this function)
main.c:150: warning: implicit declaration of function 'accept'
make: *** [main.o] Error 1
----
Can someone please tell me I'm doing something stupid, so I can get past this one hurdle?
Cheers!