I'm pretty new to PS2 development, and trying to get to grips with making iop modules.
I'm trying to build an IRX that uses ps2ip code using the latest ps2sdk. The code I am using basically looks like this:
Code: Select all
void * rpcHandlerFunction(int command, void * buffer, int size)
{
int s, con;
struct sockaddr_in saddr;
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
memset(&saddr, 0, sizeof(saddr));
saddr.sin_family = AF_INET;
saddr.sin_port = 80;
IP4_ADDR(((struct ip_addr*)&(saddr.sin_addr)), 192, 168, 0, 1);
con = connect(s, &saddr, sizeof(saddr));
return rpcBuffer;
}
- iop-gcc -miop -nostdlib -L/usr/local/ps2dev/ps2sdk/iop/lib -o ./iop.irx iop_main.o -lkernel -lkernel -lgcc
iop_main.o(.text+0x20): In function `rpcHandlerFunction':
iop_main.c: undefined reference to `lwip_socket'
iop_main.o(.text+0x78):iop_main.c: undefined reference to `lwip_connect'
collect2: ld returned 1 exit status
make: *** [iop.irx] Error 1
I assume that these functions are provided by the ps2ip IRX since there aren't any libraries for the IOP except kernel, but how do I tell the linker that they won't be provided at link time?
Any ideas what I'm missing? Any help would be very appreciated.
// TJ