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
Creating a PSP Library
I've managed to find the problem.rinco wrote:links fine for me... -L. -ltest
but i have to wonder why you've declared the function as external.
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: Select all
#ifdef __cplusplus
extern "C"
{
#endif
int TestFunction();
#ifdef __cplusplus
}
#endif
I shoulda guessed this one!!!
Thanks for all your help.
Cheers,
71M
-
- Posts: 22
- Joined: Sat Sep 10, 2005 6:45 am
taken from this post:
http://forums.ps2dev.org/viewtopic.php? ... sc&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
http://forums.ps2dev.org/viewtopic.php? ... sc&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