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 

Creating a PSP Library

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



Joined: 21 Jun 2005
Posts: 122
Location: London

PostPosted: Mon Aug 01, 2005 6:39 am    Post subject: Creating a PSP Library Reply with quote

Hi,
I'm having problems creating a lib file for the PSP.
The library compiles and creates a .a file, but when I try and link the lib into my project I get an 'undefined reference to...' error.

www.easy-monkey.co.uk/libtest.rar

Hope somebody can help me figure this one out.

Thanks,
71M
Back to top
View user's profile Send private message
71M



Joined: 21 Jun 2005
Posts: 122
Location: London

PostPosted: Mon Aug 01, 2005 10:55 pm    Post subject: Reply with quote

Alternatively does anyone have an example of a simple library that works?
I've successfully compiled and linked in libpng and zlib, but can't see any differences between those library definitions and the ones I've created.

Cheers,
71M
Back to top
View user's profile Send private message
rinco



Joined: 21 Jan 2005
Posts: 255
Location: Canberra, Australia

PostPosted: Mon Aug 01, 2005 11:32 pm    Post subject: Reply with quote

links fine for me... -L. -ltest
but i have to wonder why you've declared the function as external.
Back to top
View user's profile Send private message
71M



Joined: 21 Jun 2005
Posts: 122
Location: London

PostPosted: Mon Aug 01, 2005 11:39 pm    Post subject: Reply with quote

rinco wrote:
links fine for me... -L. -ltest
but i have to wonder why you've declared the function as external.


I've managed to find the problem.
I bet you're linking the lib into a C project. Trying to link it into a C++ project throws up the errors.
By changing the header to this -

Code:
#ifdef __cplusplus
extern "C"
{
#endif

int   TestFunction();

#ifdef __cplusplus
}
#endif


It links correctly!
I shoulda guessed this one!!!
Thanks for all your help.

Cheers,
71M
Back to top
View user's profile Send private message
elevationsnow



Joined: 10 Sep 2005
Posts: 22

PostPosted: Mon Sep 12, 2005 1:57 am    Post subject: Reply with quote

could you tell me how you succefully installed libpng im using cygwin and it just doesnt want to install
Back to top
View user's profile Send private message
liquid8d



Joined: 30 Jun 2005
Posts: 66

PostPosted: Tue Sep 13, 2005 2:16 pm    Post subject: Reply with quote

taken from this post:

http://forums.ps2dev.org/viewtopic.php?t=3112&postdays=0&postorder=asc&start=0

----------------------
in your Cygwin Bash Shell (or whatever you use) enter the folowing lines;
svn co svn://svn.ps2dev.org/psp/trunk/zlib -- press [Enter] and wait for the prompt to show back up.
svn co svn://svn.ps2dev.org/psp/trunk/libpng -- press [Enter] and wait for the prompt to show back up.

[Edit] Those two lines up just above this look like links to websites, but they're not, so don't even bother clicking on them.

then you need to change your directory in the bash shell to your psptoolchain/zlib folder, and then type 'make' and then 'make install'
then change the directory over to your psptoolchain/libpng folder and type 'make' and 'make install' again.

You need to include png.h and you need to add the following to your makefile;

Code:
LIBS = -lpng -lz
----------------------------

LiQuiD8d
Back to top
View user's profile Send private message AIM Address
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