[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Solaris and socket library

From: John Ling
Subject: Solaris and socket library
Date: Fri, 16 Jan 2004 16:56:40 -0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3

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

Do I do this in somehow or in Is there a better way anyone can suggest. I would think something like this is a common problem to handle.

John Ling

reply via email to

[Prev in Thread] Current Thread [Next in Thread]