forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simple include problems with PSPSDK samples

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
cakestick



Joined: 22 Jan 2006
Posts: 6

PostPosted: Mon Jan 23, 2006 2:09 am    Post subject: Simple include problems with PSPSDK samples Reply with quote

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!
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Jan 23, 2006 2:37 am    Post subject: Reply with quote

This is because you do not have the latest version of newlib built and installed. The BSD sockets network includes are part of newlib and not pspsdk so that is why you are getting the errors.
Back to top
View user's profile Send private message
cakestick



Joined: 22 Jan 2006
Posts: 6

PostPosted: Mon Jan 23, 2006 2:44 am    Post subject: Reply with quote

:-D Thank you, this is something I couldn't have dug up in 5 Sunday mornings, haha..

Is newlib a module that can be pulled down in cygwin setup, or do I have to get it from somewhere else?
Back to top
View user's profile Send private message
cakestick



Joined: 22 Jan 2006
Posts: 6

PostPosted: Mon Jan 23, 2006 2:50 am    Post subject: Reply with quote

Nevermind, I put myself on the right track with svn checkout - only reply if I'm completely off-base.

Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group