Link to home
Create AccountLog in
Avatar of effectivista
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.
Avatar of dog_
dog_

I'm not a linu programmer but I would say that it does not know where to look for the pthread_detach and pthread_create functions. Check these ideas:

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
ASKER CERTIFIED SOLUTION
Avatar of Chipzter
Chipzter

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of effectivista

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 :->
)
 
run "man recvfrom" or check this tutorial: http://www.linuxgazette.com/node/8758