LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-05-2005, 05:23 AM   #1
mchitrakar
Member
 
Registered: Mar 2004
Posts: 93
Blog Entries: 1

Rep: Reputation: 15
what is lsockets?


I have to re-run a sco-ux program into linux.
by simply copying the program and runnning make cmd.didnt work.
somebody told me to chq makefile. I did. Here it is. (see bottom)
Since cc did not work, i did gcc. fine.
however, error appeared as

<<error>>
gcc -o sr1 vser.o tmpfile.o gen_sh_put.o gen_sh_ipc.o gen_sh_semop.o -lnsl -lsocket
/usr/bin/ld: cannot open output file sr1: Permission denied
collect2: ld returned 1 exit status
make: *** [sr1] Error 1
<<end of error message>>

I want to know what does lsockets mean?
a portion of makefile is given below.

<<a portion of makefile>>
"#makefile for tcp/ip programs.
INC = $(HOME)/hdr
LIBDIR = $(HOME)/lib
CFLAGS = cc -c
GFLAGS = cc -c -g
LIB = -lnsl -lsocket
HEADERS = \
../hdr/gen_shm.h \
makefile
OBJECTS = gen_sh_put.o gen_sh_ipc.o gen_sh_semop.o

target:sr1 cel1 pingmon

sane: $(HEADERS)
echo > jnk.o
/bin/rm -f *.o
echo > sane
...................................."
 
Old 08-05-2005, 06:16 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
The -lsocket part of the compile line means "link against libsocket".

-l<insert anything here> means "link against lib<insert same thing here>"

In order for this to work lib<blah> must be in your lib path defined by ld.so.conf (usually in /etc).

EDIT: There is no special socket library you need to link against to use sockets in linux. So you can probably remove that part anyway.

BTW.. moved to Programming because I feel it makes a little more sense there...

Last edited by jtshaw; 08-05-2005 at 06:18 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration