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 

Why pthread link faild

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



Joined: 15 Dec 2008
Posts: 5

PostPosted: Fri Apr 17, 2009 9:26 pm    Post subject: Why pthread link faild Reply with quote

Hi guys
I want to use pthread in my program, and I finded pthread.h in pspsdk.
It complite successfully,but linking error. what lib would I link?

Quote:
psp-gcc -Ig:/Software/PSP/TOPOC_pspdev/TOPOC_pspdev/pspdev/psp/sdk/include/libc
-I. -I./Network -I. -Ig:/Software/PSP/TOPOC_pspdev/TOPOC_pspdev/pspdev/psp/sdk/i
nclude -O2 -G0 -Wall -D_POSIX_THREADS -DNO_GETADDRINFO -D_PSP_FW_VERSION=371 -
L. -Lg:/Software/PSP/TOPOC_pspdev/TOPOC_pspdev/pspdev/psp/sdk/lib -specs=g:/Soft
ware/PSP/TOPOC_pspdev/TOPOC_pspdev/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-Tg:/Softw
are/PSP/TOPOC_pspdev/TOPOC_pspdev/pspdev/psp/sdk/lib/linkfile.prx main.o Netwo
rk/Base64.o Network/CircularBuffer.o Network/ISocketHandler.o Network/Ipv4Addres
s.o Network/Ipv6Address.o Network/Mutex.o Network/Parse.o Network/RandomNumber.o
Network/ResolvServer.o Network/ResolvSocket.o Network/Socket.o Network/SocketHa
ndler.o Network/StdoutLog.o Network/TcpSocket.o Network/Thread.o Network/UdpSock
et.o Network/socket_include.o Network/Utility.o g:/Software/PSP/TOPOC_pspdev/TOP
OC_pspdev/pspdev/psp/sdk/lib/prxexports.o -lstdc++ -lc -lpspdebug -lpspdisplay -
lpspge -lpspctrl -lpspsdk -lpsplibc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspn
et_resolver -lpsputility -lpspuser -lpspkernel -o test.elf
Network/Mutex.o: In function `Mutex::Unlock()':
Mutex.cpp:(.text+0x0): undefined reference to `pthread_mutex_unlock'
Network/Mutex.o: In function `Mutex::Lock()':
Mutex.cpp:(.text+0x8): undefined reference to `pthread_mutex_lock'
Network/Mutex.o: In function `Mutex::~Mutex()':
Mutex.cpp:(.text+0x10): undefined reference to `pthread_mutex_destroy'
Network/Mutex.o: In function `Mutex::~Mutex()':
Mutex.cpp:(.text+0x18): undefined reference to `pthread_mutex_destroy'
Network/Mutex.o: In function `Mutex::Mutex()':
Mutex.cpp:(.text+0x20): undefined reference to `pthread_mutex_init'
Network/Mutex.o: In function `Mutex::Mutex()':
Mutex.cpp:(.text+0x28): undefined reference to `pthread_mutex_init'
Network/Thread.o: In function `Thread::Thread(bool)':
Thread.cpp:(.text+0x248): undefined reference to `pthread_attr_init'
Thread.cpp:(.text+0x254): undefined reference to `pthread_attr_setdetachstate'
Thread.cpp:(.text+0x26c): undefined reference to `pthread_create'
Network/Thread.o: In function `Thread::Thread(bool)':
Thread.cpp:(.text+0x304): undefined reference to `pthread_attr_init'
Thread.cpp:(.text+0x310): undefined reference to `pthread_attr_setdetachstate'
Thread.cpp:(.text+0x328): undefined reference to `pthread_create'
Network/Utility.o: In function `Utility::ThreadID()':
Utility.cpp:(.text+0x74): undefined reference to `pthread_self'
collect2: ld returned 1 exit status
make: *** [test.elf] Error 1
Back to top
View user's profile Send private message
leonliu



Joined: 15 Dec 2008
Posts: 5

PostPosted: Fri Apr 17, 2009 11:57 pm    Post subject: Reply with quote

I solved it :)

I got a lib http://sourceforge.net/projects/pthreads-emb/
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