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 

Adding custom libraries (newbie)

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



Joined: 24 Jun 2005
Posts: 7
Location: Canada

PostPosted: Fri Jun 24, 2005 11:21 pm    Post subject: Adding custom libraries (newbie) Reply with quote

Hello everyone,

I just got started on developing my first PSP programs a couple of days ago after I got the PSP toolchain installed on Linux. I was able to get Hello World working and I modified the code to do some cool stuff. Also, thanks to this forum - and searching through it - I have learned lots. I'm an intermediate C programmer although I haven't programmed in a long time, but the PSP seems to have started a new hobby. ;-)

Anyways, I have encountered a few problems along the way in writing a new program. One of them is, I can't even access string functions like strcpy and strdup, as well as sprintf. I had read that someone had suggested using the CSD Development Library to accomplish this... but has anyone tried it? And also, how would I compile the libraries in Linux with the latest PSP toolchain? I have never added libraries to a compiler in Linux. The instructions in the text file are in some other language, and the makefile refers to another compiler.

If you have any suggestions on how to get these common C functions working for the PSP, please let me know. I apologize if I overlooked something obvious.

Thanks!
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jun 25, 2005 12:53 am    Post subject: Reply with quote

Just link with libc which is included in the psptoolchain.

Pass -lc on the linker command line.
Back to top
View user's profile Send private message
dandev



Joined: 24 Jun 2005
Posts: 7
Location: Canada

PostPosted: Sat Jun 25, 2005 1:44 am    Post subject: Reply with quote

mrbrown wrote:
Just link with libc which is included in the psptoolchain.

Pass -lc on the linker command line.



I tried that last night as well. I'm at work so I don't have access to my home PC right now, but I had added the -lc in the PSP LD command. Do I have to put it in the right order in that particular command line?
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jun 25, 2005 1:50 am    Post subject: Reply with quote

Use psp-gcc to link instead of psp-ld. Order matters. Search this very forum because I think this is like the umpteenth time I've repeated this information :P.
Back to top
View user's profile Send private message
dandev



Joined: 24 Jun 2005
Posts: 7
Location: Canada

PostPosted: Sat Jun 25, 2005 2:17 am    Post subject: Reply with quote

mrbrown wrote:
Use psp-gcc to link instead of psp-ld. Order matters. Search this very forum because I think this is like the umpteenth time I've repeated this information :P.


No need to get upset over it. I searched this forum for libc/string functions last night and didn't see that information, and I don't have as much time on my hands to read every single post. I was hoping this information would be on a sticky, as it seems like an obvious question for people getting into this environment. Just a suggestion.

Thanks for the help though.
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