Why pthread link faild

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
leonliu
Posts: 5
Joined: Mon Dec 15, 2008 12:39 am

Why pthread link faild

Post by leonliu »

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?
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
leonliu
Posts: 5
Joined: Mon Dec 15, 2008 12:39 am

Post by leonliu »

Post Reply