effectivista
asked on
linux network programming
hi
i am new to linux network programming. I am facing problem in making threaded TCP Server. I have used pthread.h in the main program. but i am getting error like this ->
)
[root@www CSockets]# gcc -o thread TCPEchoServer-Thread.c
/tmp/ccmibAQF.o(.text+0xb4 ): In function `main':
: undefined reference to `pthread_create'
/tmp/ccmibAQF.o(.text+0xfa ): In function `ThreadMain':
: undefined reference to `pthread_detach'
collect2: ld returned 1 exit status
How can I remove these error from my program. Are pthread_create() and pthread_detach are not member of pthread.h or how can i replace these functions.
pls quick hint or suggest. U are welcome.
i am new to linux network programming. I am facing problem in making threaded TCP Server. I have used pthread.h in the main program. but i am getting error like this ->
)
[root@www CSockets]# gcc -o thread TCPEchoServer-Thread.c
/tmp/ccmibAQF.o(.text+0xb4
: undefined reference to `pthread_create'
/tmp/ccmibAQF.o(.text+0xfa
: undefined reference to `pthread_detach'
collect2: ld returned 1 exit status
How can I remove these error from my program. Are pthread_create() and pthread_detach are not member of pthread.h or how can i replace these functions.
pls quick hint or suggest. U are welcome.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
hi Chipzter
i tried to compile with command given by u. It works.
thank u. I want to know about UDP server also. i want to create a concurrent UDP server
how can i do this. any idea pls :->
)
i tried to compile with command given by u. It works.
thank u. I want to know about UDP server also. i want to create a concurrent UDP server
how can i do this. any idea pls :->
)
run "man recvfrom" or check this tutorial: http://www.linuxgazette.com/node/8758
is pthread.h included in the main?
make sure your include path has the path to the directory with pthread.h in it.
try putting a copy of pthread.h in you working directory