#93 Solaris needs LIBS="-lnsl -lsocket"

open
nobody
5
2011-01-12
2011-01-12
Mark
No

host:/var/tmp/wput-0.6.2 root# uname -a
SunOS host 5.10 Generic_142909-17 sun4v sparc SUNW,T5240

wput 0.6.2

The normal configure doesn't add "-lnsl and -lsocket" for Solaris (5.9, 5.10 and 5.11)

CFLAGS=-g
CC=cc
CXX=CC
LDFLAGS=-I/usr/local/include -L/usr/local/lib
CPPFLAGS=-I/usr/local/include -L/usr/local/lib

[...]
./configure --prefix=/wput \ --with-libiconv-prefix=/usr/local \ --with-libintl-prefix=/usr/local \ --with-gnutls-includes=/usr/local \ --with-gnutls-libs=/usr/local/lib
gmake

[...]
cc -o ../wput wput.o netrc.o ftp.o ftplib.o utils.o progress.o socketlib.o queue.o ftp-ls.o /usr/local/lib/libintl.so /usr/local/lib/libiconv.so -lc -R/usr/local/lib -L/usr/local/lib -lgnutls-openssl
Undefined first referenced
symbol in file
bind socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
recv socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
send socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
getsockname socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
accept socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
listen socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
gethostbyname socketlib.o (symbol belongs to implicit dependency /lib/libnsl.so.1)
socket socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
connect socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
shutdown socketlib.o (symbol belongs to implicit dependency /lib/libsocket.so.1)
ld: fatal: symbol referencing errors. No output written to ../wput
gmake[1]: *** [wput] Error 1
gmake[1]: Leaving directory `/var/tmp/wput-0.6.2/src'

Adding:

LIBS=-lnsl -lsocket

before running configure solves this.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks