using socket.

when I write some code with functions of socket,some error will occurr.
The error is that “gcc don’t find the function of socket”, perhaps I must
link some library.
But how should I do when I link the right library?
I wish some gentleman tell me, a lot of thanks.


Lipy
Best Regards

Lipy <lipy@stelect.com.cn> wrote:

when I write some code with functions of socket,some error will occurr.
The error is that “gcc don’t find the function of socket”, perhaps I must
link some library.
But how should I do when I link the right library?

-lsocket

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Thank you very much firstly.
But when I used the function “socketpair()”,the compile error is that “the
function socketpair is not to be found”,even if I linked the library
“-lsocket”.Who would tell me how to use the function “socketpair()” in QNX.


Lipy
Best Regards

Lipy <lipy@stelect.com.cn> wrote:

Thank you very much firstly.
But when I used the function “socketpair()”,the compile error is that “the
function socketpair is not to be found”,even if I linked the library
“-lsocket”.Who would tell me how to use the function “socketpair()” in QNX.

/home/seanb >nm /lib/libsocket.so | grep socketpair
000197b4 T socketpair

Are you using an old version?

-seanb

socketpair() was not implemented in 6.1, but got added in 6.2


Jens

“Lipy” <lipy@stelect.com.cn> wrote in message
news:b824bf$8fv$1@inn.qnx.com

Thank you very much firstly.
But when I used the function “socketpair()”,the compile error is that “the
function socketpair is not to be found”,even if I linked the library
“-lsocket”.Who would tell me how to use the function “socketpair()” in
QNX.


Lipy
Best Regards