using threads with gcc on fedora (undefined reference to pthread_create)

2006-07-19 Thread Abid Ghufran

I am using thread in my application.

When i try to compile the code, the gcc says that the "pthread_create"
is an undefined reference. I have included the library pthread.h. Is
there something else that i need to do.

What options do I have to use when compiling my code?
Is there any document on this?

thanks,

Abid Ghufran.


send a structure containing a pointer to another structure, over socket stream

2006-07-23 Thread Abid Ghufran

I am working on an application over fedora using c language and
sockets (TCP). I have to send a structure which contains a pointer to
another strcuture. Now what happens is that when the primary structure
(containing the pointer) gets sent, instead of the secondary structure
(pointed to) being sent, only its pointer get sent. This is quite
normal and obvious as the original strucutre, contains the pointer as
a data member, and does not contain as a member the structure being
pointed to.

I am using send and receive for this purpose. How can i manage the
send(ing) and receive(ing) of the primary and the secondary structure?

[The primary structure contains the control information and the
secondary structure contains the data information, and they together
form sort of a header and payload].

Thank you,

Abid Ghufran.