Request 288 was acted upon.
_________________________________________________________________________

         URL: https://rt.openpkg.org/id/288
      Ticket: [OpenPKG #288]
     Subject: Linux gcc -lsocket problem
  Requestors: [EMAIL PROTECTED]
       Queue: openpkg
       Owner: Nobody
      Status: new
 Transaction: Ticket created by [EMAIL PROTECTED]
        Time: Thu Nov 20 09:16:36 2003
_________________________________________________________________________


Hi all,I wrote a simple client server Socket program. Icompiled them successfully but 
when i try to createthe executables, as shownn below, i get the givenerror. These 
programs are already tested on Solaris m/cs andthey work fine there.This is the error 
i am getting. Please let me know ifu have the [EMAIL PROTECTED] csfiles]# [EMAIL 
PROTECTED] csfiles]# lsTCPClient.c  TCPServer.o   connectsock.c  errexit.o    
passivesock.cTCPClient.o  connectTCP.c  connectsock.o  passiveTCP.c 
passivesock.oTCPServer.c  connectTCP.o  errexit.c      [EMAIL PROTECTED] csfiles]# 
[EMAIL PROTECTED] csfiles]# [EMAIL PROTECTED] csfiles]# [EMAIL PROTECTED] csfiles]# 
[EMAIL PROTECTED] csfiles]# gcc TCPClient.o connectTCP.oconnectsock.o  errexit.o  -o 
client -lsocket -lnsl/usr/bin/ld: cannot find -lsocketcollect2: ld returned 1 exit 
[EMAIL PROTECTED] csfiles]#----------------------------------------------------
Also when i do not provide the
-lsocket option it gives me reference errors for the
variable "errno". So then i commented this variable
wherever it was being used and then cud generate the
executable w/o providing -lsocket but still providing
-lnsl option.

But then the same client server program which runs for
Solaris m/c is not running for the Linux m/c. It gives
Segmentation fault.

My guess is the executable was not generated properly.


Did any one of you any time face such error. Can you please let
me know any solution u know. any help is highly appreciated.

You can mail me at [EMAIL PROTECTED]

Thanks,
Amita




Hi all,

I wrote a simple client server Socket program. I
compiled them successfully but when i try to create
the executables, as shownn below, i get the given
error. 
These programs are already tested on Solaris m/cs and
they work fine there.

This is the error i am getting. Please let me know if
u have the solution.

------------------------------------------------------
[EMAIL PROTECTED] csfiles]# 
[EMAIL PROTECTED] csfiles]# ls
TCPClient.c  TCPServer.o   connectsock.c  errexit.o   
 passivesock.c
TCPClient.o  connectTCP.c  connectsock.o  passiveTCP.c
 passivesock.o
TCPServer.c  connectTCP.o  errexit.c      passiveTCP.o
[EMAIL PROTECTED] csfiles]# 
[EMAIL PROTECTED] csfiles]# 
[EMAIL PROTECTED] csfiles]# 
[EMAIL PROTECTED] csfiles]# 
[EMAIL PROTECTED] csfiles]# gcc TCPClient.o connectTCP.o
connectsock.o  errexit.o  -o client -lsocket -lnsl
/usr/bin/ld: cannot find -lsocket
collect2: ld returned 1 exit status
[EMAIL PROTECTED] csfiles]#

----------------------------------------------------

Also when i do not provide the
-lsocket option it gives me reference errors for the
variable "errno". So then i commented this variable
wherever it was being used and then cud generate the
executable w/o providing -lsocket but still providing
-lnsl option.

But then the same client server program which runs for
Solaris m/c is not running for the Linux m/c. It gives
Segmentation fault.

My guess is the executable was not generated properly.


Did any one of you any time face such error. Can you please let
me know any solution u know. any help is highly appreciated.
You can mail me at [EMAIL PROTECTED]

Thanks,
Amita

Reply via email to