[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Solaris and socket library
From: |
jling |
Subject: |
Re: Solaris and socket library |
Date: |
Fri, 16 Jan 2004 21:22:07 -0800 |
Thank you Bob for that very useful bit of knowledge.
John Ling
----- Original Message -----
From: Bob Friesenhahn <address@hidden>
Date: Friday, January 16, 2004 5:14 pm
Subject: Re: Solaris and socket library
> This is an Autoconf issue, not Automake. Adding the following
> line to
> your configure.ac file will likely resolve the problem:
>
> AC_SEARCH_LIBS([connect],[socket],[],[],[])
>
> It should add -lsocket to LIBS if necessary.
>
> Bob
>
> On Fri, 16 Jan 2004, John Ling wrote:
>
> > I am running on Solaris and I was trying to compile an
> application that
> > used the libmysqlclient.a library.
> >
> > I encountered an error:
> >
> > Undefined first referenced
> > symbol in file
> > socket
> > /usr/local/mysql4/lib/libmysqlclient.a(libmysql.o)
> > getpeername
> > /usr/local/mysql4/lib/libmysqlclient.a(viosocket.o)
> > setsockopt
> > /usr/local/mysql4/lib/libmysqlclient.a(viosocket.o)
> > getservbyname
> > /usr/local/mysql4/lib/libmysqlclient.a(libmysql.o)
> > getsockopt
> > /usr/local/mysql4/lib/libmysqlclient.a(libmysql.o)
> > shutdown
> > /usr/local/mysql4/lib/libmysqlclient.a(viosocket.o)
> > connect
> > /usr/local/mysql4/lib/libmysqlclient.a(libmysql.o)
> > ld: fatal: Symbol referencing errors.
> >
> >
> > Now the solution was to add a -lsocket to the linking options.
> > But, should this not be something that autoconf or automake
> suite of
> > tools detect and automatically handle for me? Do I need to
> manually add
> > this only when I run on Solaris?
> >
> > Now that I do need to handle this. Where is the best place to
> check the
> > OS environment variable to see if I need to set this as a variable
> > somewhere. I wanted to do something like:
> >
> > ifeq ($(OSTYPE),solaris)
> > export SOCKET = -lsocket
> > endif
> >
> > Do I do this in configure.in somehow or in Makefile.am? Is
> there a
> > better way anyone can suggest. I would think something like
> this is a
> > common problem to handle.
> >
> > Thanks,
> > John Ling
> >
> >
> >
>
> ======================================
> Bob Friesenhahn
> address@hidden
> http://www.simplesystems.org/users/bfriesen
>
>
>
>