[Top][All Lists]

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

Re: Issue with static linking?

From: Ralf Wildenhues
Subject: Re: Issue with static linking?
Date: Wed, 17 Sep 2008 23:42:12 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Micheal,

* Micheal Smith wrote on Mon, Sep 15, 2008 at 11:23:57PM CEST:
> I'm not sure if this is more of a libtool issue, or an automake  
> issue.

Probably neither.

> I have some code that relies on libresolv to do mx lookups.   
> This code uses functions within that library that are not exported  
> unless compiled with the -static flag.

I think the problem is that you shouldn't use these functions.
Find out why you think you need them.  Then get rid of that need.  :-)

One workaround would be to link the program completely static
(-all-static), but I'm guessing it still won't give you the
functionality you need (some of glibc's networking stuff only
works from the shared library).  And of course other functionality,
which you have already found out.

> gcc -g -O2 -o program main.o auth.o crypto.o errors.o htable.o  
> interface.o llist.o logging.o smtplib.o socklib.o  ./.libs/libmxresolv.a  
> -lssl -lpthread -lpam ./.libs/libmxresolv.a(mxresolver.o): In function 
> `mx_lookup':
> undefined reference to `__ns_initparse'
> undefined reference to `__ns_parserr'
> undefined reference to `__ns_name_uncompress'


reply via email to

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