QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

Compiling Error...

This is a discussion on Compiling Error... within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hi again, i've read the manual about sockets on C. I think that i made a socket without error (i ...

Reply
 
LinkBack Thread Tools
Old 02-15-2008, 12:37 AM   #1
 
Join Date: Feb 2008
Posts: 6
Trader Feedback: 0
Default Compiling Error...

Hi again, i've read the manual about sockets on C. I think that i made a socket without error (i hope) but i can't compile it =/. This is the error of the SDK:

Code:
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o main.c
main.c : In function 'main':
main.c(75) : warning: implicit declaration of function 'close'
main.c(101) : column 2 :  warning: no newline at end of file
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -LC:/pspdev/psp/sdk/l
ib   main.o -lpspnet -lpspnet_inet -lpspdebug -lpspdisplay -lpspge -lpspctrl -lp
spsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -
lpspuser -lpspkernel -o Sockets.elf
psp-fixup-imports Sockets.elf
Error, could not fixup imports, stubs out of order.
Ensure the SDK libraries are linked in last to correct this error
make: *** [Sockets.elf] Error 1
And this is the MakeFile:

Code:
TARGET = Sockets
OBJS = main.o

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR = 
LDFLAGS = 
LIBS = -lpspnet -lpspnet_inet

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Sockets C

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
moz-art is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-15-2008, 12:50 AM   #2

Developer
 
Join Date: Mar 2006
Posts: 1,026
Trader Feedback: 0
Default

Quote:
main.c(75) : warning: implicit declaration of function 'close'
#include <unistd.h>

Quote:
Error, could not fixup imports, stubs out of order.
Remove -lpspnet and -lpspnet_inet from the LIBS line in your makefile.
__________________

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197

Quote:
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
Insert_Witty_Name is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-15-2008, 01:20 AM   #3
 
Join Date: Feb 2008
Posts: 6
Trader Feedback: 0
Default

O_O Amazinggg!!!...

Now it can compile!!! *-*, thank you so much, i see you know about this!...

But, how can i activate the wifi connection for connecting to my access point to test my "client"??...

Because the socket always says:

Code:
Error when creating socket!
Closing Application...
the code for create the socket that i made is:

Code:
...
int sock;
sock = socket(AF_INET, SOCK_STREAM, 0);
if(sock == -1)
	{
		printf("Error when creating socket!\n");
		printf("Closing Application...");
		sceKernelDelayThread(time_out); //time_out = 50*1000
		sceKernelExitGame();
	}
...

Last edited by moz-art; 02-16-2008 at 01:38 PM..
moz-art is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-15-2008, 01:51 AM   #4

Developer
 
Join Date: Mar 2006
Posts: 1,026
Trader Feedback: 0
Default

Have you connected to the access point?

Check out the SDK samples for connecting to an access point - samples/net/simple which also uses sockets or samples/utility/netdialog.
__________________

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197

Quote:
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
Insert_Witty_Name is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-16-2008, 12:11 PM   #5
 
Join Date: Feb 2008
Posts: 6
Trader Feedback: 0
Default

I was reading the code, but i don't understand why i have to create a thread for the process to connect an access point. The function wich make all is "connect_to_apctl", but i don't know why i have to invoque it with "new_thread".

To initialize the Inet Modules i have to do pspSdkLoadInetModules(), and it returns 0 (or bigger than, i guest) on succesfully or < 0 on error. Then i have to call the process wich start the WLan, i mean, pspSdkInetInit(), i don't know what returns, i think 1 on succesfully (because de if just do the sentences on true/1), or 0 on error...i'm so confused ...

Insert_Witty_Name, could you explain me that?, why i have to call connect_to_apctl with new_thread?, and, could i call it with something simplifiest?
moz-art is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-16-2008, 12:20 PM   #6

Developer
 
Join Date: Mar 2006
Posts: 1,026
Trader Feedback: 0
Default

For loading on 3.xx firmwares, the new thread isn't needed.

Also, don't use the pspSdk functions to load the modules, instead use sceUtilityLoadNetModule() .

If you're on 1.5, then ignore the above - you need kernel mode to load the modules, but user mode for the rest of the program, hence the thread.
__________________

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197

Quote:
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
Insert_Witty_Name is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-16-2008, 01:34 PM   #7
 
Join Date: Feb 2008
Posts: 6
Trader Feedback: 0
Default

This is more clearest, thank you =P...

I'll try to do for 3.xx with sceUtilityLoadNetModule() ;...now i know why had to convert to 1.50 the eboot.pbp compiled with the pspsdk.

So, i hope i can do this =), thank you again, i will post the result...
moz-art is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
compiling , error

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 12:32 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us